public abstract class SimpleProtocolEncoderOutput extends Object implements ProtocolEncoderOutput
ProtocolEncoderOutput
based on queue.Constructor and Description |
---|
SimpleProtocolEncoderOutput() |
Modifier and Type | Method and Description |
---|---|
protected abstract WriteFuture |
doFlush(ByteBuffer buf) |
WriteFuture |
flush()
Flushes all buffers you wrote via
ProtocolEncoderOutput.write(ByteBuffer) to
the session. |
Queue<ByteBuffer> |
getBufferQueue() |
void |
mergeAll()
Merges all buffers you wrote via
ProtocolEncoderOutput.write(ByteBuffer) into
one ByteBuffer and replaces the old fragmented ones with it. |
void |
write(ByteBuffer buf)
Callback for
ProtocolEncoder to generate encoded
ByteBuffer s. |
public Queue<ByteBuffer> getBufferQueue()
public void write(ByteBuffer buf)
ProtocolEncoderOutput
ProtocolEncoder
to generate encoded
ByteBuffer
s. ProtocolEncoder
must call
ProtocolEncoderOutput.write(ByteBuffer)
for each encoded message.write
in interface ProtocolEncoderOutput
buf
- the buffer which contains encoded datapublic void mergeAll()
ProtocolEncoderOutput
ProtocolEncoderOutput.write(ByteBuffer)
into
one ByteBuffer
and replaces the old fragmented ones with it.
This method is useful when you want to control the way MINA generates
network packets.mergeAll
in interface ProtocolEncoderOutput
public WriteFuture flush()
ProtocolEncoderOutput
ProtocolEncoderOutput.write(ByteBuffer)
to
the session. This operation is asynchronous; please wait for
the returned WriteFuture
if you want to wait for
the buffers flushed.flush
in interface ProtocolEncoderOutput
protected abstract WriteFuture doFlush(ByteBuffer buf)
Copyright © 2004–2014 Apache MINA Project. All rights reserved.