public class NumberEncoder extends MessageToByteEncoder<java.lang.Number>
Number
into the binary representation prepended with
a magic number ('F' or 0x46) and a 32-bit length prefix. For example, 42
will be encoded to { 'F', 0, 0, 0, 1, 42 }.ChannelHandler.Sharable
构造器和说明 |
---|
NumberEncoder() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
encode(ChannelHandlerContext ctx,
java.lang.Number msg,
ByteBuf out)
Encode a message into a
ByteBuf . |
acceptOutboundMessage, allocateBuffer, write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
protected void encode(ChannelHandlerContext ctx, java.lang.Number msg, ByteBuf out)
MessageToByteEncoder
ByteBuf
. This method will be called for each written message that can be handled
by this encoder.encode
在类中 MessageToByteEncoder<java.lang.Number>
ctx
- the ChannelHandlerContext
which this MessageToByteEncoder
belongs tomsg
- the message to encodeout
- the ByteBuf
into which the encoded message will be written