Edit

Share via


Serializer<T>.Serialize Method

Definition

Overloads

Serialize(T, Stream, SerializerSession, Int32)

Serializes the provided value into destination.

Serialize(T, Span<Byte>, SerializerSession)

Serializes the provided value into destination.

Serialize(T, Memory<Byte>, SerializerSession)

Serializes the provided value into destination.

Serialize(T, Stream, Int32)

Serializes the provided value into destination.

Serialize(T, Memory<Byte>)

Serializes the provided value into destination.

Serialize(T, Span<Byte>)

Serializes the provided value into destination.

Serialize(T, Byte[])

Serializes the provided value into destination.

Serialize(T, Byte[], SerializerSession)

Serializes the provided value into destination.

Serialize<TBufferWriter>(T, TBufferWriter, SerializerSession)

Serializes the provided value into destination.

Serialize<TBufferWriter>(T, Writer<TBufferWriter>)

Serializes the provided value into destination.

Serialize<TBufferWriter>(T, TBufferWriter)

Serializes the provided value into destination.

Serialize(T, Stream, SerializerSession, Int32)

Serializes the provided value into destination.

public void Serialize (T value, System.IO.Stream destination, Orleans.Serialization.Session.SerializerSession session, int sizeHint = 0);
member this.Serialize : 'T * System.IO.Stream * Orleans.Serialization.Session.SerializerSession * int -> unit
Public Sub Serialize (value As T, destination As Stream, session As SerializerSession, Optional sizeHint As Integer = 0)

Parameters

value
T

The value to serialize.

destination
Stream

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

sizeHint
Int32

The estimated upper bound for the length of the serialized data.

Remarks

The destination stream will not be flushed by this method.

Applies to

Serialize(T, Span<Byte>, SerializerSession)

Serializes the provided value into destination.

public void Serialize (T value, ref Span<byte> destination, Orleans.Serialization.Session.SerializerSession session);
member this.Serialize : 'T * Span * Orleans.Serialization.Session.SerializerSession -> unit
Public Sub Serialize (value As T, ByRef destination As Span(Of Byte), session As SerializerSession)

Parameters

value
T

The value to serialize.

destination
Span<Byte>

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(T, Memory<Byte>, SerializerSession)

Serializes the provided value into destination.

public void Serialize (T value, ref Memory<byte> destination, Orleans.Serialization.Session.SerializerSession session);
member this.Serialize : 'T * Memory * Orleans.Serialization.Session.SerializerSession -> unit
Public Sub Serialize (value As T, ByRef destination As Memory(Of Byte), session As SerializerSession)

Parameters

value
T

The value to serialize.

destination
Memory<Byte>

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(T, Stream, Int32)

Serializes the provided value into destination.

public void Serialize (T value, System.IO.Stream destination, int sizeHint = 0);
member this.Serialize : 'T * System.IO.Stream * int -> unit
Public Sub Serialize (value As T, destination As Stream, Optional sizeHint As Integer = 0)

Parameters

value
T

The value to serialize.

destination
Stream

The destination where serialized data will be written.

sizeHint
Int32

The estimated upper bound for the length of the serialized data.

Remarks

The destination stream will not be flushed by this method.

Applies to

Serialize(T, Memory<Byte>)

Serializes the provided value into destination.

public void Serialize (T value, ref Memory<byte> destination);
member this.Serialize : 'T * Memory -> unit
Public Sub Serialize (value As T, ByRef destination As Memory(Of Byte))

Parameters

value
T

The value to serialize.

destination
Memory<Byte>

The destination where serialized data will be written.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(T, Span<Byte>)

Serializes the provided value into destination.

public void Serialize (T value, ref Span<byte> destination);
member this.Serialize : 'T * Span -> unit
Public Sub Serialize (value As T, ByRef destination As Span(Of Byte))

Parameters

value
T

The value to serialize.

destination
Span<Byte>

The destination where serialized data will be written.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(T, Byte[])

Serializes the provided value into destination.

public int Serialize (T value, byte[] destination);
member this.Serialize : 'T * byte[] -> int
Public Function Serialize (value As T, destination As Byte()) As Integer

Parameters

value
T

The value to serialize.

destination
Byte[]

The destination where serialized data will be written.

Returns

The length of the serialized data.

Applies to

Serialize(T, Byte[], SerializerSession)

Serializes the provided value into destination.

public int Serialize (T value, byte[] destination, Orleans.Serialization.Session.SerializerSession session);
member this.Serialize : 'T * byte[] * Orleans.Serialization.Session.SerializerSession -> int
Public Function Serialize (value As T, destination As Byte(), session As SerializerSession) As Integer

Parameters

value
T

The value to serialize.

destination
Byte[]

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

Returns

The length of the serialized data.

Applies to

Serialize<TBufferWriter>(T, TBufferWriter, SerializerSession)

Serializes the provided value into destination.

public void Serialize<TBufferWriter> (T value, TBufferWriter destination, Orleans.Serialization.Session.SerializerSession session) where TBufferWriter : System.Buffers.IBufferWriter<byte>;
member this.Serialize : 'T * 'BufferWriter * Orleans.Serialization.Session.SerializerSession -> unit (requires 'BufferWriter :> System.Buffers.IBufferWriter<byte>)
Public Sub Serialize(Of TBufferWriter As IBufferWriter(Of Byte)) (value As T, destination As TBufferWriter, session As SerializerSession)

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
T

The value to serialize.

destination
TBufferWriter

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

Applies to

Serialize<TBufferWriter>(T, Writer<TBufferWriter>)

Serializes the provided value into destination.

public void Serialize<TBufferWriter> (T value, ref Orleans.Serialization.Buffers.Writer<TBufferWriter> destination) where TBufferWriter : System.Buffers.IBufferWriter<byte>;
member this.Serialize : 'T * Writer -> unit (requires 'BufferWriter :> System.Buffers.IBufferWriter<byte>)
Public Sub Serialize(Of TBufferWriter As IBufferWriter(Of Byte)) (value As T, ByRef destination As Writer(Of TBufferWriter))

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
T

The value to serialize.

destination
Writer<TBufferWriter>

The destination where serialized data will be written.

Applies to

Serialize<TBufferWriter>(T, TBufferWriter)

Serializes the provided value into destination.

public void Serialize<TBufferWriter> (T value, TBufferWriter destination) where TBufferWriter : System.Buffers.IBufferWriter<byte>;
member this.Serialize : 'T * 'BufferWriter -> unit (requires 'BufferWriter :> System.Buffers.IBufferWriter<byte>)
Public Sub Serialize(Of TBufferWriter As IBufferWriter(Of Byte)) (value As T, destination As TBufferWriter)

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
T

The value to serialize.

destination
TBufferWriter

The destination where serialized data will be written.

Applies to