BinaryFormatter Alternative

I am buying an alternative / replacement for BinaryFormatter.

In the current issues that I have with BinaryFormatter (and alternatives should solve this),

1) backward compatibility (you can deserialize classes serialized using an earlier version)
2) size
3) speed

I checked the AltSerializer, which looks fine, some conflicting speed reports, but it looks like it supports backward compatibility.

I also looked at protobuf-net , which looks fantastic, except that a lot of work will be required at this point, since you need to define all .proto.

Perhaps someone who uses the above or something else will comment.

+3
source share
3 answers

Since then, I found out that protobuf-net will respect the attributes [DataContract] and [DataMember] (no .protos), so if your classes are WCF-ready or you want to decorate them with the above attributes, then you can use protobuf -net out of the box for your classes.

It takes some work to decorate all your classes (v1 protobuf requires this), however I understand that v2 will be able to model the model for your incompetent classes.

+1
source

For backward compatibility: use any of the IFormatter.Binder, ISerializationSurrogate, OptionalFieldAttribute, IDeserializationCallback API.

: Gramma.Serialization FastBinaryFormatter, BinaryFormatter, IFormatter, .NET, .

+1

Source: https://habr.com/ru/post/1760306/


All Articles