Class ByteArrayCodec

    • Constructor Detail

      • ByteArrayCodec

        public ByteArrayCodec()
    • Method Detail

      • encodeKey

        public void encodeKey​(byte[] key,
                              ByteBuf target)
        Description copied from interface: ToByteBufEncoder
        Encode the key for output to redis.
        Specified by:
        encodeKey in interface ToByteBufEncoder<byte[],​byte[]>
        Parameters:
        key - the key, may be null.
        target - the target buffer, must not be null.
      • encodeValue

        public void encodeValue​(byte[] value,
                                ByteBuf target)
        Description copied from interface: ToByteBufEncoder
        Encode the value for output to redis.
        Specified by:
        encodeValue in interface ToByteBufEncoder<byte[],​byte[]>
        Parameters:
        value - the value, may be null.
        target - the target buffer, must not be null.
      • estimateSize

        public int estimateSize​(Object keyOrValue)
        Description copied from interface: ToByteBufEncoder
        Estimates the size of the resulting byte stream. This method is called for keys and values to estimate the size for the temporary buffer to allocate.
        Specified by:
        estimateSize in interface ToByteBufEncoder<byte[],​byte[]>
        Parameters:
        keyOrValue - the key or value, may be null.
        Returns:
        the estimated number of bytes in the encoded representation.
      • decodeKey

        public byte[] decodeKey​(ByteBuffer bytes)
        Description copied from interface: RedisCodec
        Decode the key output by redis.
        Specified by:
        decodeKey in interface RedisCodec<byte[],​byte[]>
        Parameters:
        bytes - Raw bytes of the key, must not be null.
        Returns:
        The decoded key, may be null.
      • decodeValue

        public byte[] decodeValue​(ByteBuffer bytes)
        Description copied from interface: RedisCodec
        Decode the value output by redis.
        Specified by:
        decodeValue in interface RedisCodec<byte[],​byte[]>
        Parameters:
        bytes - Raw bytes of the value, must not be null.
        Returns:
        The decoded value, may be null.
      • encodeKey

        public ByteBuffer encodeKey​(byte[] key)
        Description copied from interface: RedisCodec
        Encode the key for output to redis.
        Specified by:
        encodeKey in interface RedisCodec<byte[],​byte[]>
        Parameters:
        key - the key, may be null.
        Returns:
        The encoded key, never null.
      • encodeValue

        public ByteBuffer encodeValue​(byte[] value)
        Description copied from interface: RedisCodec
        Encode the value for output to redis.
        Specified by:
        encodeValue in interface RedisCodec<byte[],​byte[]>
        Parameters:
        value - the value, may be null.
        Returns:
        The encoded value, never null.