<PackageReference Include="System.Runtime.Serialization.Formatters" Version="11.0.0-preview.5.26302.115" />

System.Runtime.Serialization.Formatters.Binary.BinaryFormatter

public sealed class BinaryFormatter : IFormatter
Serializes and deserializes an object, or an entire graph of connected objects, in binary format.

Gets or sets the behavior of the deserializer with regards to finding and loading assemblies.

public SerializationBinder Binder { get; set; }

(Insecure) Gets or sets an object of type SerializationBinder that controls the binding of a serialized object to a type.

public StreamingContext Context { get; set; }

Gets or sets the StreamingContext for this formatter.

public TypeFilterLevel FilterLevel { get; set; }

Gets or sets the TypeFilterLevel of automatic deserialization the BinaryFormatter performs.

Gets or sets a ISurrogateSelector that controls type substitution during serialization and deserialization.

public FormatterTypeStyle TypeFormat { get; set; }

Gets or sets the format in which type descriptions are laid out in the serialized stream.

public BinaryFormatter()

Initializes a new instance of the BinaryFormatter class with default values.

Initializes a new instance of the BinaryFormatter class with a given surrogate selector and streaming context.

public object Deserialize(Stream serializationStream)

Deserializes the specified stream into an object graph.

public void Serialize(Stream serializationStream, object graph)

Serializes the object, or graph of objects with the specified top (root), to the given stream.