public abstract class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage> extends AbstractMemcacheObjectEncoder<M>
A MessageToByteEncoder
that encodes binary memache messages into bytes.
Constructor and Description |
---|
AbstractBinaryMemcacheEncoder() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
encodeHeader(io.netty.buffer.ByteBuf buf,
M msg)
Encode the header.
|
protected io.netty.buffer.ByteBuf |
encodeMessage(io.netty.channel.ChannelHandlerContext ctx,
M msg)
Take the given
MemcacheMessage and encode it into a writable ByteBuf . |
acceptOutboundMessage, encode
bind, close, connect, deregister, disconnect, flush, read
exceptionCaught, handlerAdded, handlerRemoved, isSharable
protected io.netty.buffer.ByteBuf encodeMessage(io.netty.channel.ChannelHandlerContext ctx, M msg)
AbstractMemcacheObjectEncoder
Take the given MemcacheMessage
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.protected abstract void encodeHeader(io.netty.buffer.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.buf
- the ByteBuf
to write into.msg
- the message to encode.