public class SimpleProtocolEncoderOutput extends java.lang.Object implements ProtocolEncoderOutput
ProtocolEncoderOutput
based on queue.Constructor and Description |
---|
SimpleProtocolEncoderOutput() |
Modifier and Type | Method and Description |
---|---|
Queue |
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 getBufferQueue()
public void write(ByteBuffer buf)
ProtocolEncoderOutput
ProtocolEncoder
to generate encoded
ByteBuffer
s. ProtocolEncoder
must call
ProtocolEncoderOutput.write(ByteBuffer)
for each decoded messages.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