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

System.Runtime.Serialization.Formatter

public abstract class Formatter : IFormatter
Provides base functionality for the common language runtime serialization formatters.

Contains the ObjectIDGenerator used with the current formatter.

protected Queue m_objectQueue

Contains a Queue of the objects left to serialize.

public abstract SerializationBinder Binder { get; set; }

When overridden in a derived class, gets or sets the SerializationBinder used with the current formatter.

public abstract StreamingContext Context { get; set; }

When overridden in a derived class, gets or sets the StreamingContext used for the current serialization.

public abstract ISurrogateSelector SurrogateSelector { get; set; }

When overridden in a derived class, gets or sets the ISurrogateSelector used with the current formatter.

protected Formatter()

Initializes a new instance of the Formatter class.

public abstract object Deserialize(Stream serializationStream)

When overridden in a derived class, deserializes the stream attached to the formatter when it was created, creating a graph of objects identical to the graph originally serialized into that stream.

protected virtual object GetNext(out long objID)

Returns the next object to serialize, from the formatter's internal work queue.

protected virtual long Schedule(object obj)

Schedules an object for later serialization.

public abstract void Serialize(Stream serializationStream, object graph)

When overridden in a derived class, serializes the graph of objects with the specified root to the stream already attached to the formatter.

protected abstract void WriteArray(object obj, string name, Type memberType)

When overridden in a derived class, writes an array to the stream already attached to the formatter.

protected abstract void WriteBoolean(bool val, string name)

When overridden in a derived class, writes a Boolean value to the stream already attached to the formatter.

protected abstract void WriteByte(byte val, string name)

When overridden in a derived class, writes an 8-bit unsigned integer to the stream already attached to the formatter.

protected abstract void WriteChar(char val, string name)

When overridden in a derived class, writes a Unicode character to the stream already attached to the formatter.

protected abstract void WriteDateTime(DateTime val, string name)

When overridden in a derived class, writes a DateTime value to the stream already attached to the formatter.

protected abstract void WriteDecimal(decimal val, string name)

When overridden in a derived class, writes a Decimal value to the stream already attached to the formatter.

protected abstract void WriteDouble(double val, string name)

When overridden in a derived class, writes a double-precision floating-point number to the stream already attached to the formatter.

protected abstract void WriteInt16(short val, string name)

When overridden in a derived class, writes a 16-bit signed integer to the stream already attached to the formatter.

protected abstract void WriteInt32(int val, string name)

When overridden in a derived class, writes a 32-bit signed integer to the stream.

protected abstract void WriteInt64(long val, string name)

When overridden in a derived class, writes a 64-bit signed integer to the stream.

protected virtual void WriteMember(string memberName, object data)

Inspects the type of data received, and calls the appropriate Write method to perform the write to the stream already attached to the formatter.

protected abstract void WriteObjectRef(object obj, string name, Type memberType)

When overridden in a derived class, writes an object reference to the stream already attached to the formatter.

protected abstract void WriteSByte(sbyte val, string name)

When overridden in a derived class, writes an 8-bit signed integer to the stream already attached to the formatter.

protected abstract void WriteSingle(float val, string name)

When overridden in a derived class, writes a single-precision floating-point number to the stream already attached to the formatter.

protected abstract void WriteTimeSpan(TimeSpan val, string name)

When overridden in a derived class, writes a TimeSpan value to the stream already attached to the formatter.

protected abstract void WriteUInt16(ushort val, string name)

When overridden in a derived class, writes a 16-bit unsigned integer to the stream already attached to the formatter.

protected abstract void WriteUInt32(uint val, string name)

When overridden in a derived class, writes a 32-bit unsigned integer to the stream already attached to the formatter.

protected abstract void WriteUInt64(ulong val, string name)

When overridden in a derived class, writes a 64-bit unsigned integer to the stream already attached to the formatter.

protected abstract void WriteValueType(object obj, string name, Type memberType)

When overridden in a derived class, writes a value of the given type to the stream already attached to the formatter.