public interface ToByteBufEncoder<K,V>
ByteBuf
. This encoder does not allocate buffers, it just
encodes data to existing buffers.
Classes implementing ToByteBufEncoder
are required to implement RedisCodec
as well. You should implement also
the RedisCodec.encodeKey(Object)
and RedisCodec.encodeValue(Object)
methods to ensure compatibility for users
that access the RedisCodec
API only.
Modifier and Type | Method and Description |
---|---|
void |
encodeKey(K key,
ByteBuf target)
Encode the key for output to redis.
|
void |
encodeValue(V value,
ByteBuf target)
Encode the value for output to redis.
|
int |
estimateSize(Object keyOrValue)
Estimates the size of the resulting byte stream.
|
void encodeKey(K key, ByteBuf target)
key
- the key, may be null.target
- the target buffer, must not be null.void encodeValue(V value, ByteBuf target)
value
- the value, may be null.target
- the target buffer, must not be null.int estimateSize(Object keyOrValue)
keyOrValue
- the key or value, may be null.Copyright © 2017 lettuce.io. All rights reserved.