public class ObjectSerializationEncoder extends ProtocolEncoderAdapter
Constructor and Description |
---|
ObjectSerializationEncoder()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(IoSession session,
Object message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data.
|
int |
getMaxObjectSize() |
void |
setMaxObjectSize(int maxObjectSize)
Sets the allowed maximum size of the encoded object.
|
dispose
public ObjectSerializationEncoder()
public int getMaxObjectSize()
IllegalArgumentException
. The default value
is Integer.MAX_VALUE
.public void setMaxObjectSize(int maxObjectSize)
IllegalArgumentException
. The default value
is Integer.MAX_VALUE
.maxObjectSize
- the maximum size for an encoded objectpublic void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception
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
.session
- The current Sessionmessage
- the message to encodeout
- The ProtocolEncoderOutput
that will receive the encoded messageException
- if the message violated protocol specificationCopyright © 2004–2021 Apache MINA Project. All rights reserved.