@UnstableApi public abstract class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage> extends AbstractMemcacheObjectEncoder<M>
MessageToByteEncoder that encodes binary memcache messages into bytes.ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private static int |
MINIMUM_HEADER_SIZE
Every binary memcache message has at least a 24 bytes header.
|
| Constructor and Description |
|---|
AbstractBinaryMemcacheEncoder() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
encodeExtras(ByteBuf buf,
ByteBuf extras)
Encode the extras.
|
protected abstract void |
encodeHeader(ByteBuf buf,
M msg)
Encode the header.
|
private static void |
encodeKey(ByteBuf buf,
ByteBuf key)
Encode the key.
|
protected ByteBuf |
encodeMessage(ChannelHandlerContext ctx,
M msg)
Take the given
MemcacheMessage and encode it into a writable ByteBuf. |
acceptOutboundMessage, encodewritebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprivate static final int MINIMUM_HEADER_SIZE
protected ByteBuf encodeMessage(ChannelHandlerContext ctx, M msg)
AbstractMemcacheObjectEncoderMemcacheMessage and encode it into a writable ByteBuf.encodeMessage in class AbstractMemcacheObjectEncoder<M extends BinaryMemcacheMessage>ctx - the channel handler context.msg - the message to encode.ByteBuf representation of the message.private static void encodeExtras(ByteBuf buf, ByteBuf extras)
buf - the ByteBuf to write into.extras - the extras to encode.private static void encodeKey(ByteBuf buf, ByteBuf key)
buf - the ByteBuf to write into.key - the key to encode.