Class ObjectSerializationEncoder
- java.lang.Object
-
- org.apache.mina.filter.codec.ProtocolEncoderAdapter
-
- org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder
-
- All Implemented Interfaces:
ProtocolEncoder
public class ObjectSerializationEncoder extends ProtocolEncoderAdapter
-
-
Constructor Summary
Constructors Constructor Description ObjectSerializationEncoder()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out)Encodes higher-level message objects into binary or protocol-specific data.intgetMaxObjectSize()Returns 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
-
-
-
-
Method Detail
-
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
public void encode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out) throws java.lang.Exception
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:
java.lang.Exception- if the message violated protocol specification
-
-