Class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage>
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelOutboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageEncoder<Object>
-
- io.netty.handler.codec.memcache.AbstractMemcacheObjectEncoder<M>
-
- io.netty.handler.codec.memcache.binary.AbstractBinaryMemcacheEncoder<M>
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
BinaryMemcacheRequestEncoder,BinaryMemcacheResponseEncoder
@UnstableApi public abstract class AbstractBinaryMemcacheEncoder<M extends BinaryMemcacheMessage> extends AbstractMemcacheObjectEncoder<M>
AMessageToByteEncoderthat encodes binary memcache messages into bytes.
-
-
Constructor Summary
Constructors Constructor Description AbstractBinaryMemcacheEncoder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidencodeHeader(io.netty.buffer.ByteBuf buf, M msg)Encode the header.protected io.netty.buffer.ByteBufencodeMessage(io.netty.channel.ChannelHandlerContext ctx, M msg)Take the givenMemcacheMessageand encode it into a writableByteBuf.-
Methods inherited from class io.netty.handler.codec.memcache.AbstractMemcacheObjectEncoder
acceptOutboundMessage, encode
-
Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, read
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
encodeMessage
protected io.netty.buffer.ByteBuf encodeMessage(io.netty.channel.ChannelHandlerContext ctx, M msg)Description copied from class:AbstractMemcacheObjectEncoderTake the givenMemcacheMessageand encode it into a writableByteBuf.- Specified by:
encodeMessagein classAbstractMemcacheObjectEncoder<M extends BinaryMemcacheMessage>- Parameters:
ctx- the channel handler context.msg- the message to encode.- Returns:
- the
ByteBufrepresentation of the message.
-
encodeHeader
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.- Parameters:
buf- theByteBufto write into.msg- the message to encode.
-
-