BEFORE ENCODE (300 bytes) AFTER ENCODE (302 bytes) +---------------+ +--------+---------------+ | Protobuf Data |-------------->| Length | Protobuf Data | | (300 bytes) | | 0xAC02 | (300 bytes) | +---------------+ +--------+---------------+*
CodedOutputStream, CodedOutputByteBufferNano
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int | Returns: size of value encoded as protobuf varint32.which is to be encoded. value)Computes size of protobuf varint32 after encoding. |
| protected void | encode(ChannelHandlerContext
the ctx, ByteBuf ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode msg, ByteBuf the out)ByteBuf into which the encoded message will be writtenImplements abstract io. ByteBuf.
|
| pack-priv static void | writeRawVarint32(ByteBuf
to be written to out, int to be written value)Writes protobuf varint32 to (@link ByteBuf). |
| ProtobufVarint32LengthFieldPrepender | back to summary |
|---|---|
| public ProtobufVarint32LengthFieldPrepender() | |
| computeRawVarint32Size | back to summary |
|---|---|
| pack-priv static int computeRawVarint32Size(final int value) Computes size of protobuf varint32 after encoding.
| |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |
| writeRawVarint32 | back to summary |
|---|---|
| pack-priv static void writeRawVarint32(ByteBuf out, int value) Writes protobuf varint32 to (@link ByteBuf).
| |