Package org.apache.mina.filter.codec
Interface ProtocolEncoderOutput
-
- All Known Implementing Classes:
AbstractProtocolEncoderOutput
public interface ProtocolEncoderOutput
Callback forProtocolEncoder
to generate encoded messages such asIoBuffer
s.ProtocolEncoder
must callwrite(Object)
for each encoded message.- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteFuture
flush()
Flushes all buffers you wrote viawrite(Object)
to the session.void
mergeAll()
Merges all buffers you wrote viawrite(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
.
-
-
-
Method Detail
-
write
void write(Object encodedMessage)
Callback forProtocolEncoder
to generate an encoded message such as anIoBuffer
.ProtocolEncoder
must callwrite(Object)
for each encoded message.- Parameters:
encodedMessage
- the encoded message, typically anIoBuffer
or aFileRegion
.
-
mergeAll
void mergeAll()
Merges all buffers you wrote viawrite(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 calledwrite(Object)
method with onlyIoBuffer
s.- Throws:
IllegalStateException
- if you wrote something else thanIoBuffer
-
flush
WriteFuture flush()
Flushes all buffers you wrote viawrite(Object)
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.
-
-