Edit

Share via


ObjectSerializer.Serialize Method

Definition

Overloads

Serialize(Object, Stream, SerializerSession, Type, Int32)

Serializes the provided value into destination.

Serialize(Object, Span<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

Serialize(Object, Memory<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

Serialize(Object, Stream, Type, Int32)

Serializes the provided value into destination.

Serialize(Object, Byte[], SerializerSession, Type)

Serializes the provided value into destination.

Serialize(Object, Memory<Byte>, Type)

Serializes the provided value into destination.

Serialize(Object, Span<Byte>, Type)

Serializes the provided value into destination.

Serialize(Object, Byte[], Type)

Serializes the provided value into destination.

Serialize(Object, ArraySegment<Byte>, Type)

Serializes the provided value into destination.

Serialize(Object, ArraySegment<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

Serialize<TBufferWriter>(Object, TBufferWriter, Type)

Serializes the provided value into destination.

Serialize<TBufferWriter>(Object, Writer<TBufferWriter>, Type)

Serializes the provided value into destination.

Serialize<TBufferWriter>(Object, TBufferWriter, SerializerSession, Type)

Serializes the provided value into destination.

Serialize(Object, Stream, SerializerSession, Type, Int32)

Serializes the provided value into destination.

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

Parameters

value
Object

The value to serialize.

destination
Stream

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

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(Object, Span<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

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

Parameters

value
Object

The value to serialize.

destination
Span<Byte>

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(Object, Memory<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

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

Parameters

value
Object

The value to serialize.

destination
Memory<Byte>

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(Object, Stream, Type, Int32)

Serializes the provided value into destination.

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

Parameters

value
Object

The value to serialize.

destination
Stream

The destination where serialized data will be written.

type
Type

The expected type of the value.

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(Object, Byte[], SerializerSession, Type)

Serializes the provided value into destination.

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

Parameters

value
Object

The value to serialize.

destination
Byte[]

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

Returns

The length of the serialized data.

Applies to

Serialize(Object, Memory<Byte>, Type)

Serializes the provided value into destination.

public void Serialize (object value, ref Memory<byte> destination, Type type);
member this.Serialize : obj * Memory * Type -> unit
Public Sub Serialize (value As Object, ByRef destination As Memory(Of Byte), type As Type)

Parameters

value
Object

The value to serialize.

destination
Memory<Byte>

The destination where serialized data will be written.

type
Type

The expected type of the value.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(Object, Span<Byte>, Type)

Serializes the provided value into destination.

public void Serialize (object value, ref Span<byte> destination, Type type);
member this.Serialize : obj * Span * Type -> unit
Public Sub Serialize (value As Object, ByRef destination As Span(Of Byte), type As Type)

Parameters

value
Object

The value to serialize.

destination
Span<Byte>

The destination where serialized data will be written.

type
Type

The expected type of the value.

Remarks

This method slices the destination to the serialized data length.

Applies to

Serialize(Object, Byte[], Type)

Serializes the provided value into destination.

public int Serialize (object value, byte[] destination, Type type);
member this.Serialize : obj * byte[] * Type -> int
Public Function Serialize (value As Object, destination As Byte(), type As Type) As Integer

Parameters

value
Object

The value to serialize.

destination
Byte[]

The destination where serialized data will be written.

type
Type

The expected type of the value.

Returns

The length of the serialized data.

Applies to

Serialize(Object, ArraySegment<Byte>, Type)

Serializes the provided value into destination.

public int Serialize (object value, ArraySegment<byte> destination, Type type);
member this.Serialize : obj * ArraySegment<byte> * Type -> int
Public Function Serialize (value As Object, destination As ArraySegment(Of Byte), type As Type) As Integer

Parameters

value
Object

The value to serialize.

destination
ArraySegment<Byte>

The destination where serialized data will be written.

type
Type

The expected type of the value.

Returns

The length of the serialized data.

Applies to

Serialize(Object, ArraySegment<Byte>, SerializerSession, Type)

Serializes the provided value into destination.

public int Serialize (object value, ArraySegment<byte> destination, Orleans.Serialization.Session.SerializerSession session, Type type);
member this.Serialize : obj * ArraySegment<byte> * Orleans.Serialization.Session.SerializerSession * Type -> int
Public Function Serialize (value As Object, destination As ArraySegment(Of Byte), session As SerializerSession, type As Type) As Integer

Parameters

value
Object

The value to serialize.

destination
ArraySegment<Byte>

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

Returns

The length of the serialized data.

Applies to

Serialize<TBufferWriter>(Object, TBufferWriter, Type)

Serializes the provided value into destination.

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

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
Object

The value to serialize.

destination
TBufferWriter

The destination where serialized data will be written.

type
Type

The expected type of the value.

Applies to

Serialize<TBufferWriter>(Object, Writer<TBufferWriter>, Type)

Serializes the provided value into destination.

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

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
Object

The value to serialize.

destination
Writer<TBufferWriter>

The destination where serialized data will be written.

type
Type

The expected type of the value.

Applies to

Serialize<TBufferWriter>(Object, TBufferWriter, SerializerSession, Type)

Serializes the provided value into destination.

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

Type Parameters

TBufferWriter

The output buffer writer.

Parameters

value
Object

The value to serialize.

destination
TBufferWriter

The destination where serialized data will be written.

session
SerializerSession

The serializer session.

type
Type

The expected type of the value.

Applies to