static ExtHandHackMessage() { var headerAttribute = new Dictionary <string, object>(1) { { UtMetadataKey, 1 } }; var header = new Dictionary <string, object>(1) { { MethodKey, headerAttribute } }; ExtendHeader = BEncoder.EncodeObject(header); }
public override byte[] Encode() { //1.写入包长度 //2.写入msgId //3.写入extTypeId //4.写入字典 using (var stream = new MemoryStream()) { stream.Write(BitConverter.IsLittleEndian ? BitConverter.GetBytes(Length).Reverse().ToArray() : BitConverter.GetBytes(Length), 0, 4); stream.WriteByte(20); stream.WriteByte(ExtTypeID); BEncoder.EncodeObject(Parameters, stream); return(stream.ToArray()); } }
public byte[] BEncodeBytes() { return(BEncoder.EncodeObject(_message)); }