///
///北斗数据包 封装///
public class BeiDouContentEncoderHandler : MessageToByteEncoder{protected override voidEncode(IChannelHandlerContext context, BDBaseFrame message, IByteBuffer output)
{
EncodeFrame(message, output);
}private voidEncodeFrame(BDBaseFrame message, IByteBuffer output)
{//IByteBuffer frameBuffer = output;
output.MarkReaderIndex();//内容
IByteBuffer contentBuffer =message.EncoderContent();if (contentBuffer == null)
contentBuffer=Unpooled.Empty;//byte[] content = new byte[contentBuffer.ReadableBytes];//contentBuffer.ReadBytes(content, 0, content.Length);//写头标志
output.WriteByte(BDFrameConst.FRAME_FLAG);//消息 ID
output.WriteUnsignedShort((ushort)message.FrameType);//消息体属性 加密没做//ushort contentLen = (ushort)content.Length;
ushort contentLen = (ushort)contentBuffer.ReadableBytes;if(message.IsSubpacka