Class ObjectSerializationEncoder
java.lang.Object
org.apache.mina.filter.codec.ProtocolEncoderAdapter
org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder
- All Implemented Interfaces:
ProtocolEncoder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencode(IoSession session, Object message, ProtocolEncoderOutput out) Encodes higher-level message objects into binary or protocol-specific data.intReturns the allowed maximum size of the encoded object.voidsetMaxObjectSize(int maxObjectSize) Sets the allowed maximum size of the encoded object.Methods inherited from class org.apache.mina.filter.codec.ProtocolEncoderAdapter
dispose
-
Constructor Details
-
ObjectSerializationEncoder
public ObjectSerializationEncoder()Creates a new instance.
-
-
Method Details
-
getMaxObjectSize
public int getMaxObjectSize()Returns the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, this encoder will throw aIllegalArgumentException. The default value isInteger.MAX_VALUE. -
setMaxObjectSize
public void setMaxObjectSize(int maxObjectSize) Sets the allowed maximum size of the encoded object. If the size of the encoded object exceeds this value, this encoder will throw aIllegalArgumentException. The default value isInteger.MAX_VALUE. -
encode
Description copied from interface:ProtocolEncoderEncodes higher-level message objects into binary or protocol-specific data. MINA invokesProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)method with message which is popped from the session write queue, and then the encoder implementation puts encodedByteBuffers intoProtocolEncoderOutput.- Throws:
Exception- if the message violated protocol specification
-