public class InternalOutputBuffer extends AbstractOutputBuffer<java.net.Socket> implements ByteChunk.ByteOutputChannel
Modifier and Type | Class and Description |
---|---|
protected class |
InternalOutputBuffer.OutputStreamOutputBuffer
This class is an output buffer which will write data to an output
stream.
|
Modifier and Type | Field and Description |
---|---|
protected java.io.OutputStream |
outputStream
Underlying output stream.
|
activeFilters, bufferedWrites, bufferedWriteSize, byteCount, committed, filterLibrary, finished, headerBuffer, lastActiveFilter, outputStreamOutputBuffer, pos, response, sm
Constructor and Description |
---|
InternalOutputBuffer(Response response,
int headerBufferSize)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
commit()
Commit the response.
|
protected boolean |
flushBuffer(boolean block)
Writes any remaining buffered data.
|
protected boolean |
hasMoreDataToFlush() |
void |
init(SocketWrapper<java.net.Socket> socketWrapper,
AbstractEndpoint<java.net.Socket> endpoint) |
void |
nextRequest()
End processing of current HTTP request.
|
void |
realWriteBytes(byte[] cbuf,
int off,
int len)
Callback to write data from the buffer.
|
void |
recycle()
Recycle the output buffer.
|
protected void |
registerWriteInterest() |
void |
sendAck()
Send an acknowledgment.
|
void |
setSocketBuffer(int socketBufferSize)
Set the socket buffer size.
|
addActiveFilter, addFilter, doWrite, endHeaders, endRequest, flush, getBufferedWriteSize, getBytesWritten, getFilters, getSocketBuffer, hasBufferedData, hasDataToWrite, isBlocking, isReady, reset, sendHeader, sendStatus, setBufferedWriteSize, write, write, write, write, write
protected java.io.OutputStream outputStream
public InternalOutputBuffer(Response response, int headerBufferSize)
public void setSocketBuffer(int socketBufferSize)
setSocketBuffer
in class AbstractOutputBuffer<java.net.Socket>
public void init(SocketWrapper<java.net.Socket> socketWrapper, AbstractEndpoint<java.net.Socket> endpoint) throws java.io.IOException
init
in class AbstractOutputBuffer<java.net.Socket>
java.io.IOException
public void recycle()
recycle
in class AbstractOutputBuffer<java.net.Socket>
public void nextRequest()
nextRequest
in class AbstractOutputBuffer<java.net.Socket>
public void sendAck() throws java.io.IOException
sendAck
in class AbstractOutputBuffer<java.net.Socket>
java.io.IOException
protected void commit() throws java.io.IOException
commit
in class AbstractOutputBuffer<java.net.Socket>
java.io.IOException
- an underlying I/O error occurredpublic void realWriteBytes(byte[] cbuf, int off, int len) throws java.io.IOException
realWriteBytes
in interface ByteChunk.ByteOutputChannel
cbuf
- bytes that will be writtenoff
- offset in the bytes arraylen
- length that will be writtenjava.io.IOException
- If an I/O occurs while writing the bytesprotected boolean hasMoreDataToFlush()
hasMoreDataToFlush
in class AbstractOutputBuffer<java.net.Socket>
protected void registerWriteInterest()
registerWriteInterest
in class AbstractOutputBuffer<java.net.Socket>
protected boolean flushBuffer(boolean block) throws java.io.IOException
AbstractOutputBuffer
flushBuffer
in class AbstractOutputBuffer<java.net.Socket>
block
- Should this method block until the buffer is emptytrue
if data remains in the buffer (which can only
happen in non-blocking mode) else false
.java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.