FastBinaryFormatterSerializeT(ByteBlock, T, FastSerializerContext) 方法
序列化给定对象并将其写入字节块。
命名空间: TouchSocket.Core程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:3.0.0+ccaf96084d09f972257496d1dd63b8ba3c1e44f0
public static void Serialize<T>(
ByteBlock byteBlock,
in T graph,
FastSerializerContext serializerContext = null
)
Public Shared Sub Serialize(Of T) (
byteBlock As ByteBlock,
ByRef graph As T,
Optional serializerContext As FastSerializerContext = Nothing
)
static member Serialize :
byteBlock : ByteBlock *
graph : 'T byref *
?serializerContext : FastSerializerContext
(* Defaults:
let _serializerContext = defaultArg serializerContext null
*)
-> unit
- byteBlock ByteBlock
- 用于存储序列化数据的字节块。
- graph T
- 要序列化的对象。
- serializerContext FastSerializerContext (Optional)
- (可选)序列化上下文,提供额外的序列化设置或上下文。
- T
- 要序列化的对象类型。
此方法提供了一种便捷的方式来序列化对象至字节块,利用提供的序列化上下文进行序列化过程。