java.lang.Object
- All Implemented Interfaces:
ChannelHandler,ChannelOutboundHandler
public class CommandEncoder extends MessageToByteEncoder<Object>
A netty
ChannelHandler responsible for encoding commands.- Author:
- Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
Constructors Constructor Description CommandEncoder()CommandEncoder(boolean preferDirect) -
Method Summary
Modifier and Type Method Description protected ByteBufallocateBuffer(ChannelHandlerContext ctx, Object msg, boolean preferDirect)protected voidencode(ChannelHandlerContext ctx, Object msg, ByteBuf out)Methods inherited from class io.netty.handler.codec.MessageToByteEncoder
acceptOutboundMessage, isPreferDirect, writeMethods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Constructor Details
-
CommandEncoder
public CommandEncoder() -
CommandEncoder
public CommandEncoder(boolean preferDirect)
-
-
Method Details
-
allocateBuffer
protected ByteBuf allocateBuffer(ChannelHandlerContext ctx, Object msg, boolean preferDirect) throws Exception- Overrides:
allocateBufferin classMessageToByteEncoder<Object>- Throws:
Exception
-
encode
- Specified by:
encodein classMessageToByteEncoder<Object>- Throws:
Exception
-