public abstract class AbstractMessageEncoder extends java.lang.Object implements MessageEncoder
MessageEncoder that encodes message header and forwards
the encoding of body to a subclass.| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractMessageEncoder(int type) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
encode(IoSession session,
java.lang.Object message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
|
protected abstract void |
encodeBody(IoSession session,
AbstractMessage message,
ByteBuffer out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMessageTypespublic void encode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out) throws java.lang.Exception
MessageEncoderMessageEncoder.encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded ByteBuffers into
ProtocolEncoderOutput.encode 在接口中 MessageEncoderjava.lang.Exception - if the message violated protocol specificationprotected abstract void encodeBody(IoSession session, AbstractMessage message, ByteBuffer out)