public abstract class AbstractBinaryDecoder extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static AbstractBinaryDecoder |
DEFAULT_DECODER |
| 构造器和说明 |
|---|
AbstractBinaryDecoder(int maxFrameLength,
int lengthFieldOffset,
int lengthFieldLength,
int lengthAdjustment,
int initialBytesToStrip)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getInitialBytesToStrip() |
int |
getLengthAdjustment() |
int |
getLengthFieldLength() |
int |
getLengthFieldOffset() |
int |
getMaxFrameLength() |
abstract short |
readMessageId(io.netty.channel.Channel channel,
io.netty.buffer.ByteBuf buffer)
自定义处理完buffer后返回消息Id
|
public static final AbstractBinaryDecoder DEFAULT_DECODER
public AbstractBinaryDecoder(int maxFrameLength,
int lengthFieldOffset,
int lengthFieldLength,
int lengthAdjustment,
int initialBytesToStrip)
maxFrameLength - 每个单位的消息最大长度lengthFieldOffset - 表示长度字节的位在消息段中的偏移量lengthFieldLength - 用了多长的字节表示了长度属性lengthAdjustment - 长度调整(假如编码的长度信息比实际消息体的长度少2,那么此项设置为-2)initialBytesToStrip - 正式解码消息时跳过原始二进制序列的几个字节public abstract short readMessageId(io.netty.channel.Channel channel,
io.netty.buffer.ByteBuf buffer)
channel - buffer - public int getMaxFrameLength()
public int getLengthFieldOffset()
public int getLengthFieldLength()
public int getLengthAdjustment()
public int getInitialBytesToStrip()
Copyright © 2017. All rights reserved.