public class NumberEncoder extends OneToOneEncoder
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 java.lang.Object |
encode(ChannelHandlerContext ctx,
Channel channel,
java.lang.Object msg)
Transforms the specified message into another message and return the
transformed message.
|
doEncode, handleDownstream
protected java.lang.Object encode(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg)
OneToOneEncoder
null
, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object)
;
you must return something, at least ChannelBuffers.EMPTY_BUFFER
.encode
在类中 OneToOneEncoder