KGySoft.Serialization.Binary Namespace

KGy SOFT Core Libraries Help
Contains types for binary serialization (BinarySerializer, BinarySerializationFormatter) as well as other binary serialization related classes including serialization binders and surrogate selectors.

Public classAnyObjectSerializerWrapper Obsolete.
Provides a wrapper class for serializing any kind of object, including the ones that are not marked by the SerializableAttribute, or which are not supported by BinaryFormatter. Can be useful when a BinarySerializationFormatter payload cannot be used, so a BinaryFormatter-compatible stream must be produced. When this object is deserialized, the clone of the wrapped original object is returned.
See the Remarks section for details.
Public classCode exampleBinarySerializationFormatter
Serializes and deserializes objects in binary format.
See the Remarks section for details and for the differences to BinaryFormatter.
Public classBinarySerializer
Provides public static methods for binary serialization. Most of its methods will use a BinarySerializationFormatter instance internally.
See the Remarks section of the BinarySerializationFormatter class for details and an example.
Public classCode exampleCustomSerializationBinder
Provides a very simple customizable SerializationBinder that can convert Type to and from string by using assignable delegate properties.
See the Remarks section for details.
Public classCustomSerializerSurrogateSelector
An ISurrogateSelector implementation that makes possible to serialize and deserialize any objects, including non-serializable ones by an IFormatter such as BinarySerializationFormatter or the legacy BinaryFormatter.
See the Remarks section for details and examples.
Public classDeserializingEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.Deserializing event.
Public classCode exampleForwardedTypesSerializationBinder
Provides a SerializationBinder that makes possible to serialize and deserialize types with custom assembly identity.
See the Remarks section for details and some examples.
Public classGettingFieldEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.GettingField event.
Public classNameInvariantSurrogateSelector
An ISurrogateSelector implementation that makes possible to serialize and deserialize objects by IFormatters without storing field names. This provides compatibility for obfuscated and non-obfuscated versions of an assembly.
See the Remarks section for details.
Public classObjectDataObtainedEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.ObjectDataObtained event.
Public classObjectDataRestoredEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.ObjectDataRestored event.
Public classSerializationInfoExtensions
Provides extension methods for the SerializationInfo class.
Public classSerializingEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.Serializing event.
Public classSettingFieldEventArgs
Provides arguments for the CustomSerializerSurrogateSelector.SettingField event.
Public classWeakAssemblySerializationBinder
Provides a SerializationBinder instance for IFormatter implementations that can ignore version and token information of stored assembly name. This makes possible to deserialize objects stored in different version of the original assembly. It also can make any IFormatter safe in terms of prohibiting loading assemblies during the deserialization if the SafeMode property is .
See the Remarks section for details.

Public interfaceCode exampleIBinarySerializable
Makes possible quick and compact custom serialization of a class by BinarySerializer and BinarySerializationFormatter.
See the Remarks section for examples and details.
Public interfaceISerializationBinder
Represents a binder that can convert Type to and from string for serialization.

Public enumerationBinarySerializationOptions
Options for serialization methods in BinarySerializer and BinarySerializationFormatter classes.