package com.chamago.bison.codec.netty; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; /** * Created by pengrongxin on 2017/1/15. */ public class BisonNettyDecoder extends LengthFieldBasedFrameDecoder { /** * * @param maxFrameLength 解码时,处理每个帧数据的最大长度 * @param lengthFieldOffset 该帧数据中,存放该帧数据的长度的数据的起始位置 * @param lengthFieldLength 记录该帧数据长度的字段本身的长度 * @param lengthAdjustment 修改帧数据长度字段中定义的值,可以为负数 * @param initialBytesToStrip 解析的时候需要跳过的字节数 * @param failFast 为true,当frame长度超过maxFrameLength时立即报TooLongFrameException异常,为false,读取完整个帧再报异常 */ public BisonNettyDecoder(int maxFrameLength, int lengthFieldOffset, int lengthFieldLength, int lengthAdjustment, int initialBytesToStrip, boolean failFast) { super(maxFrameLength, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip, failFast); } }