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 WriteFuture
doFlush
(ByteBuffer buf) flush()
Flushes all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)
to the session.void
mergeAll()
Merges all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)
into oneByteBuffer
and replaces the old fragmented ones with it.void
write
(ByteBuffer buf) Callback forProtocolEncoder
to generate encodedByteBuffer
s.
-
Constructor Details
-
SimpleProtocolEncoderOutput
public SimpleProtocolEncoderOutput()
-
-
Method Details
-
getBufferQueue
-
write
Description copied from interface:ProtocolEncoderOutput
Callback forProtocolEncoder
to generate encodedByteBuffer
s.ProtocolEncoder
must callProtocolEncoderOutput.write(ByteBuffer)
for each encoded message.- Specified by:
write
in interfaceProtocolEncoderOutput
- Parameters:
buf
- the buffer which contains encoded data
-
mergeAll
public void mergeAll()Description copied from interface:ProtocolEncoderOutput
Merges all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)
into oneByteBuffer
and replaces the old fragmented ones with it. This method is useful when you want to control the way MINA generates network packets.- Specified by:
mergeAll
in interfaceProtocolEncoderOutput
-
flush
Description copied from interface:ProtocolEncoderOutput
Flushes all buffers you wrote viaProtocolEncoderOutput.write(ByteBuffer)
to the session. This operation is asynchronous; please wait for the returnedWriteFuture
if you want to wait for the buffers flushed.- Specified by:
flush
in interfaceProtocolEncoderOutput
- Returns:
- null if there is nothing to flush at all.
-
doFlush
-