FastBinaryFormatter 类
提供快速二进制序列化和反序列化功能的静态工具类。
命名空间: TouchSocket.Core程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
public static class FastBinaryFormatter
Public NotInheritable Class FastBinaryFormatter
[<AbstractClassAttribute>]
[<SealedAttribute>]
type FastBinaryFormatter = class end
- Inheritance
- Object FastBinaryFormatter
FastBinaryFormatter使用高性能的二进制序列化算法,支持基本数据类型、集合、数组、字典和自定义对象的序列化。
内置魔数校验机制,支持自定义转换器,适用于高频序列化场景。
所有序列化数据都包含协议头,用于反序列化时的快速校验。
| AddFastBinaryConverter(Type, IFastBinaryConverter) |
为指定类型添加快速二进制转换器实例。
|
| AddFastBinaryConverterTType(IFastBinaryConverter) |
为指定类型添加快速二进制转换器实例。
|
| AddFastBinaryConverterTType, TConverter |
为指定类型添加快速二进制转换器。
|
| DeserializeT(Byte, FastSerializerContext) |
从字节数组中反序列化对象。
|
| DeserializeT(ByteBlock, FastSerializerContext) |
从字节块中反序列化对象。
|
| DeserializeT(ValueByteBlock, FastSerializerContext) |
从值类型字节块中反序列化对象。
|
| DeserializeTReader(TReader, Type, FastSerializerContext) |
从字节读取器中反序列化指定类型的对象。
|
| DeserializeTReader, T(TReader, FastSerializerContext) |
从字节读取器中反序列化指定类型的对象。
|
| SerializeT(ByteBlock, T, FastSerializerContext) |
将对象序列化到字节块中。
|
| SerializeTWriter, T(TWriter, T, FastSerializerContext) |
将对象序列化到字节写入器中。
|
| SerializeToBytesT |
将对象序列化为字节数组。
|