public abstract class SimpleProtocolEncoderOutput extends java.lang.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. |
java.util.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
ByteBuffers. |
public java.util.Queue<ByteBuffer> getBufferQueue()
public void write(ByteBuffer buf)
ProtocolEncoderOutputProtocolEncoder to generate encoded
ByteBuffers. ProtocolEncoder must call
ProtocolEncoderOutput.write(ByteBuffer) for each encoded message.write in interface ProtocolEncoderOutputbuf - the buffer which contains encoded datapublic void mergeAll()
ProtocolEncoderOutputProtocolEncoderOutput.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 ProtocolEncoderOutputpublic WriteFuture flush()
ProtocolEncoderOutputProtocolEncoderOutput.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 ProtocolEncoderOutputprotected abstract WriteFuture doFlush(ByteBuffer buf)