public abstract class AbstractOutputBuffer<S> extends java.lang.Object implements OutputBuffer
| Modifier and Type | Field and Description | 
|---|---|
| protected OutputFilter[] | activeFiltersActive filter (which is actually the top of the pipeline). | 
| protected java.util.concurrent.LinkedBlockingDeque<ByteBufferHolder> | bufferedWritesFor "non-blocking" writes use an external set of buffers. | 
| protected int | bufferedWriteSizeThe max size of the buffered write buffer | 
| protected long | byteCountBytes written to client for the current request | 
| protected boolean | committedCommitted flag. | 
| protected OutputFilter[] | filterLibraryFilter library. | 
| protected boolean | finishedFinished flag. | 
| protected byte[] | headerBufferThe buffer used for header composition. | 
| protected int | lastActiveFilterIndex of the last active filter. | 
| protected OutputBuffer | outputStreamOutputBufferUnderlying output buffer. | 
| protected int | posPosition in the buffer. | 
| protected Response | responseAssociated Coyote response. | 
| protected static StringManager | smThe string manager for this package. | 
| protected int | socketBufferSocket buffering. | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | AbstractOutputBuffer(Response response,
                    int headerBufferSize) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addActiveFilter(OutputFilter filter)Add an output filter to the filter library. | 
| void | addFilter(OutputFilter filter)Add an output filter to the filter library. | 
| protected abstract void | commit() | 
| int | doWrite(ByteChunk chunk,
       Response res)Write the contents of a byte chunk. | 
| void | endHeaders()End the header block. | 
| void | endRequest()End request. | 
| void | flush()Flush the response. | 
| protected abstract boolean | flushBuffer(boolean block)Writes any remaining buffered data. | 
| int | getBufferedWriteSize() | 
| long | getBytesWritten()Bytes written to the underlying socket. | 
| OutputFilter[] | getFilters()Get filters. | 
| int | getSocketBuffer()Get the socket buffer flag. | 
| protected boolean | hasBufferedData() | 
| boolean | hasDataToWrite() | 
| protected abstract boolean | hasMoreDataToFlush() | 
| abstract void | init(SocketWrapper<S> socketWrapper,
    AbstractEndpoint<S> endpoint) | 
| protected boolean | isBlocking()Is standard Servlet blocking IO being used for output? | 
| protected boolean | isReady() | 
| void | nextRequest()End processing of current HTTP request. | 
| void | recycle()Recycle the output buffer. | 
| protected abstract void | registerWriteInterest() | 
| void | reset()Reset current response. | 
| abstract void | sendAck() | 
| void | sendHeader(MessageBytes name,
          MessageBytes value)Send a header. | 
| void | sendStatus()Send the response status line. | 
| void | setBufferedWriteSize(int bufferedWriteSize) | 
| void | setSocketBuffer(int socketBuffer)Set the socket buffer flag. | 
| void | write(byte[] b)This method will write the contents of the specified byte
 buffer to the output stream, without filtering. | 
| protected void | write(ByteChunk bc)This method will write the contents of the specified message bytes
 buffer to the output stream, without filtering. | 
| protected void | write(int i)This method will print the specified integer to the output stream,
 without filtering. | 
| protected void | write(MessageBytes mb)This method will write the contents of the specified message bytes
 buffer to the output stream, without filtering. | 
| protected void | write(java.lang.String s)This method will write the contents of the specified String to the
 output stream, without filtering. | 
protected Response response
protected boolean committed
protected boolean finished
protected byte[] headerBuffer
protected int pos
protected OutputFilter[] filterLibrary
protected OutputFilter[] activeFilters
protected int lastActiveFilter
protected OutputBuffer outputStreamOutputBuffer
protected long byteCount
protected int socketBuffer
protected final java.util.concurrent.LinkedBlockingDeque<ByteBufferHolder> bufferedWrites
protected int bufferedWriteSize
protected static final StringManager sm
protected AbstractOutputBuffer(Response response, int headerBufferSize)
public void addFilter(OutputFilter filter)
public OutputFilter[] getFilters()
public void addActiveFilter(OutputFilter filter)
public void setSocketBuffer(int socketBuffer)
public int getSocketBuffer()
public void setBufferedWriteSize(int bufferedWriteSize)
public int getBufferedWriteSize()
public int doWrite(ByteChunk chunk, Response res) throws java.io.IOException
doWrite in interface OutputBufferchunk - byte chunkres - used to allow buffers that can be shared by multiple
          responses.java.io.IOException - an underlying I/O error occurredpublic long getBytesWritten()
OutputBuffergetBytesWritten in interface OutputBufferpublic void flush()
           throws java.io.IOException
java.io.IOException - an underlying I/O error occurredpublic void reset()
java.lang.IllegalStateException - if the response has already been committedpublic void recycle()
public void nextRequest()
public void endRequest()
                throws java.io.IOException
java.io.IOException - an underlying I/O error occurredpublic abstract void init(SocketWrapper<S> socketWrapper, AbstractEndpoint<S> endpoint) throws java.io.IOException
java.io.IOExceptionpublic abstract void sendAck()
                      throws java.io.IOException
java.io.IOExceptionprotected abstract void commit()
                        throws java.io.IOException
java.io.IOExceptionpublic void sendStatus()
public void sendHeader(MessageBytes name, MessageBytes value)
name - Header namevalue - Header valuepublic void endHeaders()
protected void write(MessageBytes mb)
mb - data to be writtenprotected void write(ByteChunk bc)
bc - data to be writtenpublic void write(byte[] b)
b - data to be writtenprotected void write(java.lang.String s)
s - data to be writtenprotected void write(int i)
i - data to be writtenprotected abstract boolean hasMoreDataToFlush()
protected abstract void registerWriteInterest()
                                       throws java.io.IOException
java.io.IOExceptionprotected abstract boolean flushBuffer(boolean block)
                                throws java.io.IOException
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.IOExceptionprotected final boolean isBlocking()
protected final boolean isReady()
                         throws java.io.IOException
java.io.IOExceptionpublic boolean hasDataToWrite()
protected boolean hasBufferedData()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.