Package org.apache.mina.filter.codec
Interface ProtocolEncoderOutput
-
- All Known Implementing Classes:
SimpleProtocolEncoderOutput
public interface ProtocolEncoderOutput
Callback forProtocolEncoder
to generate encodedByteBuffer
s.ProtocolEncoder
must callwrite(ByteBuffer)
for each encoded message.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteFuture
flush()
Flushes all buffers you wrote viawrite(ByteBuffer)
to the session.void
mergeAll()
Merges all buffers you wrote viawrite(ByteBuffer)
into oneByteBuffer
and replaces the old fragmented ones with it.void
write(ByteBuffer buf)
Callback forProtocolEncoder
to generate encodedByteBuffer
s.
-
-
-
Method Detail
-
write
void write(ByteBuffer buf)
Callback forProtocolEncoder
to generate encodedByteBuffer
s.ProtocolEncoder
must callwrite(ByteBuffer)
for each encoded message.- Parameters:
buf
- the buffer which contains encoded data
-
mergeAll
void mergeAll()
Merges all buffers you wrote viawrite(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.
-
flush
WriteFuture flush()
Flushes all buffers you wrote viawrite(ByteBuffer)
to the session. This operation is asynchronous; please wait for the returnedWriteFuture
if you want to wait for the buffers flushed.- Returns:
- null if there is nothing to flush at all.
-
-