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
AProtocolEncoderOutputbased 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()voidmergeAll()Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)into oneIoBufferand replaces the old fragmented ones with it.voidwrite(Object encodedMessage)Callback forProtocolEncoderto 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 forProtocolEncoderto generate an encoded message such as anIoBuffer.ProtocolEncodermust callProtocolEncoderOutput.write(Object)for each encoded message.- Specified by:
writein interfaceProtocolEncoderOutput- Parameters:
encodedMessage- the encoded message, typically anIoBufferor aFileRegion.
-
mergeAll
public void mergeAll()
Merges all buffers you wrote viaProtocolEncoderOutput.write(Object)into oneIoBufferand 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 onlyIoBuffers.- Specified by:
mergeAllin interfaceProtocolEncoderOutput
-
-