Methods Summary |
---|
public void | endRequest()End request.
super.endRequest();
if (!useSocketBuffer && outputByteBuffer.position() != 0) {
flushBuffer();
}
|
public void | flush()Flush the buffered bytes,
super.flush();
if (outputByteBuffer.position() != 0){
flushBuffer();
}
|
public void | flushBuffer()Writes bytes to the underlying socketChannel.
if (outputByteBuffer.position() != 0){
outputByteBuffer.flip();
flushChannel(outputByteBuffer);
outputByteBuffer.clear();
}
|
public void | flushChannel(java.nio.ByteBuffer bb)Flush the buffer by looping until the ByteBuffer is empty
OutputWriter.flushChannel(socketChannel, bb);
bb.clear();
|
public java.nio.channels.SocketChannel | getChannel()Return the underlying SocketChannel
return socketChannel;
|
public void | realWriteBytes(byte[] cbuf, int off, int len)Callback to write data from the buffer.
if (len > 0) {
if (len > outputByteBuffer.remaining()){
int size = Math.max(outputByteBuffer.capacity() * 2,
len + outputByteBuffer.position());
ByteBuffer tmp = ByteBuffer.allocate(size);
outputByteBuffer.flip();
tmp.put(outputByteBuffer);
outputByteBuffer = tmp;
}
outputByteBuffer.put(cbuf, off, len);
}
|
public void | recycle()Recycle the output buffer. This should be called when closing the
connection.
response.recycle();
socketBuffer.recycle();
pos = 0;
lastActiveFilter = -1;
committed = false;
finished = false;
outputByteBuffer.clear();
socketChannel = null;
|
public void | sendAck()Send an acknoledgement without buffering.
if (!committed)
flushChannel(ACK.slice());
|
public void | setChannel(java.nio.channels.SocketChannel socketChannel)Set the underlying socket output stream.
this.socketChannel = socketChannel;
|