public interface ProtocolEncoderOutput
ProtocolEncoder
to generate encoded messages such as
IoBuffer
s. ProtocolEncoder
must call write(Object)
for each encoded message.Modifier and Type | Method and Description |
---|---|
WriteFuture |
flush()
Flushes all buffers you wrote via
write(Object) to
the session. |
void |
mergeAll()
Merges all buffers you wrote via
write(Object) into
one IoBuffer and replaces the old fragmented ones with it. |
void |
write(java.lang.Object encodedMessage)
Callback for
ProtocolEncoder to generate an encoded message such
as an IoBuffer . |
void write(java.lang.Object encodedMessage)
ProtocolEncoder
to generate an encoded message such
as an IoBuffer
. ProtocolEncoder
must call
write(Object)
for each encoded message.encodedMessage
- the encoded message, typically an IoBuffer
or a FileRegion
.void mergeAll()
write(Object)
into
one IoBuffer
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
called write(Object)
method with only IoBuffer
s.java.lang.IllegalStateException
- if you wrote something else than IoBuffer
WriteFuture flush()
write(Object)
to
the session. This operation is asynchronous; please wait for
the returned WriteFuture
if you want to wait for
the buffers flushed.Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.