Class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage>

    • Field Detail

      • MINIMUM_HEADER_SIZE

        private static final int MINIMUM_HEADER_SIZE
        Every binary memcache message has at least a 24 bytes header.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractBinaryMemcacheEncoder

        public AbstractBinaryMemcacheEncoder()
    • Method Detail

      • encodeExtras

        private static void encodeExtras​(ByteBuf buf,
                                         ByteBuf extras)
        Encode the extras.
        Parameters:
        buf - the ByteBuf to write into.
        extras - the extras to encode.
      • encodeKey

        private static void encodeKey​(ByteBuf buf,
                                      ByteBuf key)
        Encode the key.
        Parameters:
        buf - the ByteBuf to write into.
        key - the key to encode.
      • encodeHeader

        protected abstract void encodeHeader​(ByteBuf buf,
                                             M msg)
        Encode the header.

        This methods needs to be implemented by a sub class because the header is different for both requests and responses.

        Parameters:
        buf - the ByteBuf to write into.
        msg - the message to encode.