Class ProtobufVarint32LengthFieldPrepender

  • All Implemented Interfaces:
    ChannelDownstreamHandler, ChannelHandler

    @Sharable
    public class ProtobufVarint32LengthFieldPrepender
    extends OneToOneEncoder
    An encoder that prepends the the Google Protocol Buffers Base 128 Varints integer length field. For example:
     BEFORE DECODE (300 bytes)       AFTER DECODE (302 bytes)
     +---------------+               +--------+---------------+
     | Protobuf Data |-------------->| Length | Protobuf Data |
     |  (300 bytes)  |               | 0xAC02 |  (300 bytes)  |
     +---------------+               +--------+---------------+
     
    *
    See Also:
    CodedOutputStream