public abstract class SimpleProtocolEncoderOutput extends java.lang.Object implements ProtocolEncoderOutput
ProtocolEncoderOutput
based on queue.构造器和说明 |
---|
SimpleProtocolEncoderOutput() |
限定符和类型 | 方法和说明 |
---|---|
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
ByteBuffer s. |
public java.util.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
在接口中 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
在接口中 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
在接口中 ProtocolEncoderOutput
protected abstract WriteFuture doFlush(ByteBuffer buf)