MessageToByteEncoder框架可见用户使用POJO对象编码为字节数据存储到ByteBuf。用户只需定义自己的编码方法encode()即可。 首先看类签名: public abstract class MessageToByteEncoder<I> extends ChannelOutboundHandlerAdapter 可知该类只处理出站事件,切确的说是write事件
ChannelHandler 作用及设计 public interface ChannelHandler {/*** Gets called after the {@link ChannelHandler} was added to the actual context and it's ready to handle events.当把 ChannelHandler 添加到 pipel