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, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedprotected void encode(ChannelHandlerContext ctx, java.lang.Number msg, ByteBuf out)
MessageToByteEncoderByteBuf. 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