ByteBufs dynamically by the
value of the Google Protocol Buffers
Base
128 Varints integer length field in the message. For example:
BEFORE DECODE (302 bytes) AFTER DECODE (300 bytes) +--------+---------------+ +---------------+ | Length | Protobuf Data |----->| Protobuf Data | | 0xAC02 | (300 bytes) | | (300 bytes) | +--------+---------------+ +---------------+
CodedInputStream, CodedInputByteBufferNano
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | decode(ChannelHandlerContext
the ctx, ByteBuf ChannelHandlerContext which this ByteToMessageDecoder belongs tothe in, List<Object> ByteBuf from which to read datathe out)List to which decoded messages should be addedImplements abstract io. ByteBuf to an other.
|
| private static int | Returns: decoded int if buffers readerIndex has been forwarded else nonsense valueReads variable length 32bit int from buffer |
| ProtobufVarint32FrameDecoder | back to summary |
|---|---|
| public ProtobufVarint32FrameDecoder() | |
| decode | back to summary |
|---|---|
| protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception Implements abstract io. Doc from io. Decode the from one
| |
| readRawVarint32 | back to summary |
|---|---|
| private static int readRawVarint32(ByteBuf buffer) Reads variable length 32bit int from buffer
| |