private final class ByteToMessageCodec.Encoder extends MessageToByteEncoder<I>
ChannelHandler.Sharable| Constructor and Description |
|---|
Encoder(boolean preferDirect) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptOutboundMessage(java.lang.Object msg)
Returns
true if the given message should be handled. |
protected void |
encode(ChannelHandlerContext ctx,
I msg,
ByteBuf out)
Encode a message into a
ByteBuf. |
allocateBuffer, isPreferDirect, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic boolean acceptOutboundMessage(java.lang.Object msg)
throws java.lang.Exception
MessageToByteEncodertrue if the given message should be handled. If false it will be passed to the next
ChannelOutboundHandler in the ChannelPipeline.acceptOutboundMessage in class MessageToByteEncoder<I>java.lang.Exceptionprotected void encode(ChannelHandlerContext ctx, I msg, ByteBuf out) throws java.lang.Exception
MessageToByteEncoderByteBuf. This method will be called for each written message that can be handled
by this encoder.encode in class MessageToByteEncoder<I>ctx - the ChannelHandlerContext which this MessageToByteEncoder belongs tomsg - the message to encodeout - the ByteBuf into which the encoded message will be writtenjava.lang.Exception - is thrown if an error occurs