Class SimpleProtocolEncoderOutput
java.lang.Object
org.apache.mina.filter.codec.support.SimpleProtocolEncoderOutput
- All Implemented Interfaces:
ProtocolEncoderOutput
A
ProtocolEncoderOutput based on queue.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract WriteFuturedoFlush(ByteBuffer buf) flush()Flushes all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)to the session.voidmergeAll()Merges all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)into oneByteBufferand replaces the old fragmented ones with it.voidwrite(ByteBuffer buf) Callback forProtocolEncoderto generate encodedByteBuffers.
-
Constructor Details
-
SimpleProtocolEncoderOutput
public SimpleProtocolEncoderOutput()
-
-
Method Details
-
getBufferQueue
-
write
Description copied from interface:ProtocolEncoderOutputCallback forProtocolEncoderto generate encodedByteBuffers.ProtocolEncodermust callProtocolEncoderOutput.write(ByteBuffer)for each encoded message.- Specified by:
writein interfaceProtocolEncoderOutput- Parameters:
buf- the buffer which contains encoded data
-
mergeAll
public void mergeAll()Description copied from interface:ProtocolEncoderOutputMerges all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)into oneByteBufferand replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets.- Specified by:
mergeAllin interfaceProtocolEncoderOutput
-
flush
Description copied from interface:ProtocolEncoderOutputFlushes all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)to the session. This operation is asynchronous; please wait for the returnedWriteFutureif you want to wait for the buffers flushed.- Specified by:
flushin interfaceProtocolEncoderOutput- Returns:
- null if there is nothing to flush at all.
-
doFlush
-