KGySoft.Serialization.Binary Namespace

The KGySoft.Serialization.Binary namespace contains types for binary serialization (BinarySerializer, BinarySerializationFormatter) as well as other binary serialization related classes including serialization binders and surrogate selectors.

Classes

AnyObjectSerializerWrapper 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.
Obsolete.
BinarySerializationFormatter Serializes and deserializes objects in binary format.
BinarySerializer Provides public static methods for binary serialization. Most of its methods use a BinarySerializationFormatter instance internally.
See the Remarks section of the BinarySerializationFormatter class for details and examples.
CustomSerializationBinder Provides a very simple customizable SerializationBinder that can convert Type to and from string by using assignable delegate properties.
CustomSerializerSurrogateSelector 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.
When targeting .NET 8 or later this class is marked as obsolete.
Obsolete.
DeserializingEventArgs Provides arguments for the CustomSerializerSurrogateSelector.Deserializing event.
ForwardedTypesSerializationBinder Provides a SerializationBinder that makes possible to serialize and deserialize types with custom assembly identity.
GettingFieldEventArgs Provides arguments for the CustomSerializerSurrogateSelector.GettingField event.
NameInvariantSurrogateSelector 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.
Obsolete.
ObjectDataObtainedEventArgs Provides arguments for the CustomSerializerSurrogateSelector.ObjectDataObtained event.
ObjectDataRestoredEventArgs Provides arguments for the CustomSerializerSurrogateSelector.ObjectDataRestored event.
SerializationInfoExtensions Provides extension methods for the SerializationInfo class.
SerializingEventArgs Provides arguments for the CustomSerializerSurrogateSelector.Serializing event.
SettingFieldEventArgs Provides arguments for the CustomSerializerSurrogateSelector.SettingField event.
WeakAssemblySerializationBinder 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 .

Interfaces

IBinarySerializable Makes possible quick and compact custom serialization of a class by BinarySerializer and BinarySerializationFormatter.
ISerializationBinder Represents a binder that can convert Type to and from string for serialization.

Enumerations

BinarySerializationOptions Options for serialization methods in BinarySerializer and BinarySerializationFormatter classes.