A fast object graph binary serialization for .NET.
- support for serialization of classes, structures and primitives at root or type member level;
- support for serialization of derived types referenced by interface, base class or abstract class type;
- support for serialization of POCO objects;
- support for standard
NonSerializedAttributeand dedicatedNonSerializedBackendAttributefor automatic properties; - support for serialization of classes without parameter-less constructor;
- serialization of
readonlyfields is not supported (such field has to be marked withNonSerializedAttributeorreadonlymodifier has to be removed)
IObjectSerializer serializer = new ObjectSerializer(); MyClass myObject = new MyClass { Number = 32, Double = 3.14, Text = "test" }; byte[] serializedData = serializer.Serialize(myObject); MyClass deserialized = serializer.Deserialize<MyClass>(serializedData);
The ObjectSerializer performs serialization/deserialization faster than standard BinaryFormatter and produces smaller data.
Solution contains ObjectSerialization.Performance project that allows to compare ObjectSerializer performance with other serializers like (BinaryFormatter, DataContractSerializer, Protobuf or Newton BSON).
The last performance comparison can be found here: Performance test results