Package org.apache.mina.filter.codec
Interface ProtocolEncoder
- All Known Implementing Classes:
ObjectSerializationEncoder
,ProtocolEncoderAdapter
,SynchronizedProtocolEncoder
,TextLineEncoder
public interface ProtocolEncoder
Encodes higher-level message objects into binary or protocol-specific data.
MINA invokes
encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded ByteBuffer
s into
ProtocolEncoderOutput
by calling
ProtocolEncoderOutput.write(ByteBuffer)
.
Please refer to
TextLineEncoder
example.
-
Method Summary
-
Method Details
-
encode
Encodes higher-level message objects into binary or protocol-specific data. MINA invokesencode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then the encoder implementation puts encodedByteBuffer
s intoProtocolEncoderOutput
.- Throws:
Exception
- if the message violated protocol specification
-
dispose
Releases all resources related with this encoder.- Throws:
Exception
- if failed to dispose all resources
-