public class GMPPProtocolEncoder extends Object implements ProtocolEncoder, GMPPProtocol
HEADER_SIZE, VT_BOOLEAN, VT_DOUBLE, VT_INTEGER, VT_LIST, VT_LONG, VT_MAP, VT_STRING, VT_VOID
Constructor and Description |
---|
GMPPProtocolEncoder() |
Modifier and Type | Method and Description |
---|---|
IoBuffer |
code(Message message) |
void |
dispose(IoSession session)
Releases all resources related with this encoder.
|
void |
encode(IoSession session,
Object message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
|
public void dispose(IoSession session) throws Exception
ProtocolEncoder
dispose
in interface ProtocolEncoder
Exception
- if failed to dispose all resourcespublic void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception
ProtocolEncoder
ProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded messages (typically IoBuffer
s)
into ProtocolEncoderOutput
.encode
in interface ProtocolEncoder
Exception
- if the message violated protocol specificationpublic IoBuffer code(Message message) throws InvalidValueTypeException
InvalidValueTypeException