public sealed class DmtpMessage : IBytesBuilder,
IRequestInfoPublic NotInheritable Class DmtpMessage
Implements IBytesBuilder, IRequestInfo[<SealedAttribute>]
type DmtpMessage =
class
interface IBytesBuilder
interface IRequestInfo
end此类表示DMTP协议的消息格式,实现了IBytesBuilder和IRequestInfo接口。
消息格式如下:
|*2*|*2*|**4**|***************n***********|
|dm|ProtocolFlags|Length|Data|
其中head为固定的"dm"标识符,ProtocolFlags为协议标志,Length为数据长度,Data为实际数据。
| DmtpMessage(UInt16) | 初始化DmtpMessage类的新实例。 |
| DmtpMessage(UInt16, ReadOnlyMemoryByte) | 初始化DmtpMessage类的新实例。 |
| MaxLength | 获取构建数据时指示内存池的申请长度。 |
| Memory | 获取消息的主体数据内存块。 |
| ProtocolFlags | 获取协议标志。 |
| BuildTWriter | 将DMTP消息构建到指定的字节写入器中。 |
| CreateFrom | 从指定的内存块中解析并创建DmtpMessage实例。 |
| Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
| GetBodyString | 将消息主体数据转换为UTF-8编码的字符串。 |
| GetHashCode | Serves as the default hash function. (继承自 Object。) |
| GetType | Gets the Type of the current instance. (继承自 Object。) |
| ToString | Returns a string that represents the current object. (继承自 Object。) |
| Head | DMTP协议的消息头部标识符。 |
| Build |
扩展方法,用于构建给定的字节块。
该方法通过引用传递字节块,以利用ref参数提高性能,避免不必要的复制。
(由 ByteBlockBuilderExtension 定义。) |
| BuildAsBytes |
将对象构建到字节数组
(由 ByteBlockBuilderExtension 定义。) |
| Map |
将源对象的属性映射到目标对象的属性中。
(由 Mapper 定义。) |
| Map |
将源对象映射到目标类型的实例。
(由 Mapper 定义。) |
| MapTTarget |
将源对象映射到指定目标类型的新实例。
(由 Mapper 定义。) |
| ToJsonString |
转换为Json
(由 SerializeConvert 定义。) |