里面主要涉及 ProtocolEncoder接口,ProtocolEncoderOutput接口,AbstractProtocolEncoderOutput抽象类
下面的源码应该是比较容易理解的
package org.apache.mina.filter.codec;
import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
/**
* Encodes higher-level message objects into binary or protocol-specific data.
* 把高层信息转换成二进制或者特定协议的数据
* MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)}
* method with message which is popped from the session write queue, and then
* the encoder implementation puts encoded messages (typically {@link IoBuffer}s)
* into {@link ProtocolEncoderOutput} by calling {@link ProtocolEncoderOutput#write(Object)}.
* <p>
* Please refer to
* <a href="../../../../../xref-examples/org/apache/mina/examples/reverser/TextLineEncoder.html"><code>