| Modifier and Type | Class and Description |
|---|---|
| protected class | Http11OutputBuffer.
This class is an output buffer which will write data to a socket. |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| protected OutputFilter[] | activeFilters
Active filters for the current request. |
| protected long | byteCount
Bytes written to client for the current request |
| protected OutputFilter[] | filterLibrary
Filter library for processing the response body. |
| protected final ByteBuffer | headerBuffer
The buffer used for header composition. |
| protected int | lastActiveFilter
Index of the last active filter. |
| protected HttpOutputBuffer | outputStreamOutputBuffer
Underlying output buffer. |
| protected final Response | response
Associated Coyote response. |
| protected boolean | responseFinished
Finished flag. |
| protected static final StringManager | sm
The string manager for this package. |
| protected SocketWrapperBase | socketWrapper
Wrapper for socket where data will be written to. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addActiveFilter(OutputFilter
The filter to add filter)Add an output filter to the active filters for the current response. |
| public void | |
| private void | checkLengthBeforeWrite(int length)
Checks to see if there is enough space in the buffer to write the requested number of bytes. |
| protected void | |
| public int | doWrite(ByteBuffer
data to write chunk)Implements org. Write the given data to the response. |
| public void | |
| public void | |
| public void | |
| protected boolean | Returns: true if data remains in the buffer (which can only happen in non-blocking mode) else
false.Should this method block until the buffer is empty block)Writes any remaining buffered data. |
| public long | getBytesWritten()
Implements org. Bytes written to the underlying socket. |
| public OutputFilter[] | |
| public boolean | |
| public void | |
| protected final boolean | Returns: true if this is blocking IOIs standard Servlet blocking IO being used for output? |
| pack-priv boolean | |
| protected final boolean | |
| public void | |
| public void | |
| public void | |
| pack-priv void | resetHeaderBuffer()
Reset the header buffer if an error occurs during the writing of the headers so the error response can be written. |
| public void | |
| public void | |
| public void | |
| private void | write(MessageBytes
data to be written mb)This method will write the contents of the specified message bytes buffer to the output stream, without filtering. |
| private void | |
| public void | write(byte[]
data to be written b)This method will write the contents of the specified byte buffer to the output stream, without filtering. |
| private void | write(int
data to be written value)This method will write the specified integer to the output stream. |
| ackSent | back to summary |
|---|---|
| private volatile boolean ackSent | |
| activeFilters | back to summary |
|---|---|
| protected OutputFilter[] activeFilters Active filters for the current request. | |
| byteCount | back to summary |
|---|---|
| protected long byteCount Bytes written to client for the current request | |
| filterLibrary | back to summary |
|---|---|
| protected OutputFilter[] filterLibrary Filter library for processing the response body. | |
| headerBuffer | back to summary |
|---|---|
| protected final ByteBuffer headerBuffer The buffer used for header composition. | |
| lastActiveFilter | back to summary |
|---|---|
| protected int lastActiveFilter Index of the last active filter. | |
| outputStreamOutputBuffer | back to summary |
|---|---|
| protected HttpOutputBuffer outputStreamOutputBuffer Underlying output buffer. | |
| response | back to summary |
|---|---|
| protected final Response response Associated Coyote response. | |
| responseFinished | back to summary |
|---|---|
| protected boolean responseFinished Finished flag. | |
| sm | back to summary |
|---|---|
| protected static final StringManager sm The string manager for this package. | |
| socketWrapper | back to summary |
|---|---|
| protected SocketWrapperBase<?> socketWrapper Wrapper for socket where data will be written to. | |
| Http11OutputBuffer | back to summary |
|---|---|
| protected Http11OutputBuffer(Response response, int headerBufferSize) | |
| addActiveFilter | back to summary |
|---|---|
| public void addActiveFilter(OutputFilter filter) Add an output filter to the active filters for the current response.
The filter does not have to be present in A filter can only be added to a response once. If the filter has already been added to this response then this method will be a NO-OP.
| |
| addFilter | back to summary |
|---|---|
| public void addFilter(OutputFilter filter) Add an output filter to the filter library. Note that calling this method resets the currently active filters to none.
| |
| checkLengthBeforeWrite | back to summary |
|---|---|
| private void checkLengthBeforeWrite(int length) Checks to see if there is enough space in the buffer to write the requested number of bytes. | |
| commit | back to summary |
|---|---|
| protected void commit() throws IOException Commit the response.
| |
| doWrite | back to summary |
|---|---|
| public int doWrite(ByteBuffer chunk) throws IOException Implements org. Doc from org. Write the given data to the response. The caller owns the chunks.
| |
| end | back to summary |
|---|---|
| public void end() throws IOException Implements org. Doc from org. Finish writing the current response. It is acceptable to write extra bytes using
| |
| endHeaders | back to summary |
|---|---|
| public void endHeaders() End the header block. | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements org. Flush the response.
| |
| flushBuffer | back to summary |
|---|---|
| protected boolean flushBuffer(boolean block) throws IOException Writes any remaining buffered data.
| |
| getBytesWritten | back to summary |
|---|---|
| public long getBytesWritten() Implements org. Doc from org. Bytes written to the underlying socket. This includes the effects of chunking, compression, etc.
| |
| getFilters | back to summary |
|---|---|
| public OutputFilter[] getFilters() Get filters.
| |
| hasDataToWrite | back to summary |
|---|---|
| public boolean hasDataToWrite() | |
| init | back to summary |
|---|---|
| public void init(SocketWrapperBase<?> socketWrapper) | |
| isBlocking | back to summary |
|---|---|
| protected final boolean isBlocking() Is standard Servlet blocking IO being used for output?
| |
| isChunking | back to summary |
|---|---|
| pack-priv boolean isChunking() | |
| isReady | back to summary |
|---|---|
| protected final boolean isReady() | |
| nextRequest | back to summary |
|---|---|
| public void nextRequest() End processing of current HTTP request. Note All bytes of the current request should have been already consumed. This method only resets all the pointers so that we are ready to parse the next HTTP request. | |
| recycle | back to summary |
|---|---|
| public void recycle() Recycle the output buffer. This should be called when closing the connection. | |
| registerWriteInterest | back to summary |
|---|---|
| public void registerWriteInterest() | |
| resetHeaderBuffer | back to summary |
|---|---|
| pack-priv void resetHeaderBuffer() Reset the header buffer if an error occurs during the writing of the headers so the error response can be written. | |
| sendAck | back to summary |
|---|---|
| public void sendAck() throws IOException | |
| sendHeader | back to summary |
|---|---|
| public void sendHeader(MessageBytes name, MessageBytes value) Send a header.
| |
| sendStatus | back to summary |
|---|---|
| public void sendStatus() Send the response status line. | |
| write | back to summary |
|---|---|
| private void write(MessageBytes mb) This method will write the contents of the specified message bytes buffer to the output stream, without filtering. This method is meant to be used to write the response header.
| |
| write | back to summary |
|---|---|
| private void write(ByteChunk bc) This method will write the contents of the specified byte chunk to the output stream, without filtering. This method is meant to be used to write the response header.
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) This method will write the contents of the specified byte buffer to the output stream, without filtering. This method is meant to be used to write the response header.
| |
| write | back to summary |
|---|---|
| private void write(int value) This method will write the specified integer to the output stream. This method is meant to be used to write the response header.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | doWrite(ByteBuffer
data to write chunk)Implements org. Write chunk. |
| public void | |
| public void | flush()
Implements org. Flushes any unwritten data to the client. |
| public long | getBytesWritten()
Implements org. Bytes written to the underlying socket. |
| SocketOutputBuffer | back to summary |
|---|---|
| protected SocketOutputBuffer() | |
| doWrite | back to summary |
|---|---|
| public int doWrite(ByteBuffer chunk) throws IOException Implements org. Write chunk.
| |
| end | back to summary |
|---|---|
| public void end() throws IOException Implements org. Doc from org. Finish writing the current response. It is acceptable to write extra bytes using
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements org. Doc from org. Flushes any unwritten data to the client.
| |
| getBytesWritten | back to summary |
|---|---|
| public long getBytesWritten() Implements org. Doc from org. Bytes written to the underlying socket. This includes the effects of chunking, compression, etc.
| |