public class SimpleJsonLengthDecoder extends AbstractLengthDecoder
包长(short)+ 协议编号(int) + 内容(Json)
BEFORE DECODE (306 bytes) AFTER DECODE (306 bytes) +--------+------------+---------------+ +--------+------------+---------------+ | length | opcode | Json Data |----->| length | opcode | Json Data | | 0xFFFF | 0xFFFFFFFF | (300 bytes) | | 0xFFFF | 0xFFFFFFFF | (300 bytes) | +--------+------------+---------------+ +--------+------------+---------------+
| 构造器和说明 |
|---|
SimpleJsonLengthDecoder(SimpleJsonCodec simpleJsonCodec) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
java.util.List<java.lang.Object> out) |
protected int |
readLength(io.netty.buffer.ByteBuf in)
从ByteBuf中取出长度.
|
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtpublic SimpleJsonLengthDecoder(SimpleJsonCodec simpleJsonCodec)
protected void decode(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf in,
java.util.List<java.lang.Object> out)
throws java.lang.Exception
decode 在类中 AbstractLengthDecoderjava.lang.Exceptionprotected int readLength(io.netty.buffer.ByteBuf in)
AbstractLengthDecoderreadLength 在类中 AbstractLengthDecoderin - ByteBuf对象