能够让你的代码更加干净和容易维护
There are three common techniques for splitting the stream of bytes into messages:
use fixed length messages
use a fixed length header that indicates the length of the body
using a delimiter; for example many text-based protocols append a newline (or CR LF pair) after every message
(定长编码,固定长度头部编码,分隔符)
ProtocolCodecFilter怎么编写codecfilter具体怎么实现自己的协议编码解码
1、ProtocolCodecFactory
2、ProtocolCodecFilter
3、ProtocolEncoderAdapter ProtocolEncoder
4、ProtocolDecoderAdapter ProtocolDecoder