ObjectSerializer.Serialize 方法

定义

重载

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

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

Serialize(Object, Stream, Type, Int32)

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

Serialize(Object, Memory<Byte>, Type)

将提供的 value 序列化为 destination

Serialize(Object, Span<Byte>, Type)

将提供的 value 序列化为 destination

Serialize(Object, Byte[], Type)

将提供的 value 序列化为 destination

Serialize(Object, ArraySegment<Byte>, Type)

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

Serialize<TBufferWriter>(Object, TBufferWriter, Type)

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 destination

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

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Stream

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

sizeHint
Int32

序列化数据长度的估计上限。

注解

此方法不会刷新目标流。

适用于

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

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Span<Byte>

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

注解

此方法将 destination 切片为序列化的数据长度。

适用于

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

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Memory<Byte>

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

注解

此方法将 destination 切片为序列化的数据长度。

适用于

Serialize(Object, Stream, Type, Int32)

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Stream

将写入序列化数据的目标。

type
Type

值的预期类型。

sizeHint
Int32

序列化数据长度的估计上限。

注解

此方法不会刷新目标流。

适用于

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

将提供的 value 序列化为 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

参数

value
Object

要序列化的值。

destination
Byte[]

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

返回

序列化数据的长度。

适用于

Serialize(Object, Memory<Byte>, Type)

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Memory<Byte>

将写入序列化数据的目标。

type
Type

值的预期类型。

注解

此方法将 destination 切片为序列化的数据长度。

适用于

Serialize(Object, Span<Byte>, Type)

将提供的 value 序列化为 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)

参数

value
Object

要序列化的值。

destination
Span<Byte>

将写入序列化数据的目标。

type
Type

值的预期类型。

注解

此方法将 destination 切片为序列化的数据长度。

适用于

Serialize(Object, Byte[], Type)

将提供的 value 序列化为 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

参数

value
Object

要序列化的值。

destination
Byte[]

将写入序列化数据的目标。

type
Type

值的预期类型。

返回

序列化数据的长度。

适用于

Serialize(Object, ArraySegment<Byte>, Type)

将提供的 value 序列化为 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

参数

value
Object

要序列化的值。

destination
ArraySegment<Byte>

将写入序列化数据的目标。

type
Type

值的预期类型。

返回

序列化数据的长度。

适用于

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

将提供的 value 序列化为 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

参数

value
Object

要序列化的值。

destination
ArraySegment<Byte>

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

返回

序列化数据的长度。

适用于

Serialize<TBufferWriter>(Object, TBufferWriter, Type)

将提供的 value 序列化为 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)

类型参数

TBufferWriter

输出缓冲区编写器。

参数

value
Object

要序列化的值。

destination
TBufferWriter

将写入序列化数据的目标。

type
Type

值的预期类型。

适用于

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

将提供的 value 序列化为 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)

类型参数

TBufferWriter

输出缓冲区编写器。

参数

value
Object

要序列化的值。

destination
Writer<TBufferWriter>

将写入序列化数据的目标。

type
Type

值的预期类型。

适用于

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

将提供的 value 序列化为 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)

类型参数

TBufferWriter

输出缓冲区编写器。

参数

value
Object

要序列化的值。

destination
TBufferWriter

将写入序列化数据的目标。

session
SerializerSession

序列化程序会话。

type
Type

值的预期类型。

适用于