Package org.apache.mina.filter.codec
Class AbstractProtocolEncoderOutput
- java.lang.Object
-
- org.apache.mina.filter.codec.AbstractProtocolEncoderOutput
-
- All Implemented Interfaces:
ProtocolEncoderOutput
public abstract class AbstractProtocolEncoderOutput extends Object implements ProtocolEncoderOutput
AProtocolEncoderOutput
based on queue.- Author:
- Apache MINA Project
-
-
Constructor Summary
Constructors Constructor Description AbstractProtocolEncoderOutput()
Creates an instance of AbstractProtocolEncoderOutput
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Queue<Object>
getMessageQueue()
void
mergeAll()
Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)
into oneIoBuffer
and replaces the old fragmented ones with it.void
write(Object encodedMessage)
Callback forProtocolEncoder
to generate an encoded message such as anIoBuffer
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.mina.filter.codec.ProtocolEncoderOutput
flush
-
-
-
-
Method Detail
-
write
public void write(Object encodedMessage)
Callback forProtocolEncoder
to generate an encoded message such as anIoBuffer
.ProtocolEncoder
must callProtocolEncoderOutput.write(Object)
for each encoded message.- Specified by:
write
in interfaceProtocolEncoderOutput
- Parameters:
encodedMessage
- the encoded message, typically anIoBuffer
or aFileRegion
.
-
mergeAll
public void mergeAll()
Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)
into oneIoBuffer
and replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets. Please note that this method only works when you calledProtocolEncoderOutput.write(Object)
method with onlyIoBuffer
s.- Specified by:
mergeAll
in interfaceProtocolEncoderOutput
-
-