public abstract class AbstractOutputBuffer<S> extends Object implements OutputBuffer
| Modifier and Type | Field and Description | 
|---|---|
| protected OutputFilter[] | activeFiltersActive filter (which is actually the top of the pipeline). | 
| protected byte[] | bufThe buffer used for header composition. | 
| protected long | byteCountBytes written to client for the current request | 
| protected boolean | committedCommitted flag. | 
| protected OutputFilter[] | filterLibraryFilter library. | 
| protected boolean | finishedFinished flag. | 
| 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. | 
| Constructor and Description | 
|---|
| AbstractOutputBuffer() | 
| 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. | 
| long | getBytesWritten()Bytes written to the underlying socket. | 
| OutputFilter[] | getFilters()Get filters. | 
| abstract void | init(SocketWrapper<S> socketWrapper,
    AbstractEndpoint<S> endpoint) | 
| void | nextRequest()End processing of current HTTP request. | 
| void | recycle()Recycle the output buffer. | 
| 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 | 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(CharChunk cc)This method will write the contents of the specified char
 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(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[] buf
protected int pos
protected OutputFilter[] filterLibrary
protected OutputFilter[] activeFilters
protected int lastActiveFilter
protected OutputBuffer outputStreamOutputBuffer
protected long byteCount
protected static final StringManager sm
public void addFilter(OutputFilter filter)
public OutputFilter[] getFilters()
public void addActiveFilter(OutputFilter filter)
public int doWrite(ByteChunk chunk, Response res) throws IOException
doWrite in interface OutputBufferchunk - byte chunkres - The response to which the data should be written.
                  (Should be the response already associated with the
                  OutputBuffer).IOException - an underlying I/O error occurredpublic long getBytesWritten()
OutputBuffergetBytesWritten in interface OutputBufferpublic void flush()
           throws IOException
IOException - an underlying I/O error occurredpublic void reset()
IllegalStateException - if the response has already been committedpublic void recycle()
public void nextRequest()
public void endRequest()
                throws IOException
IOException - an underlying I/O error occurredpublic abstract void init(SocketWrapper<S> socketWrapper, AbstractEndpoint<S> endpoint) throws IOException
IOExceptionpublic abstract void sendAck()
                      throws IOException
IOExceptionprotected abstract void commit()
                        throws IOException
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 writtenprotected void write(CharChunk cc)
cc - data to be writtenpublic void write(byte[] b)
b - data to be writtenprotected void write(String s)
s - data to be writtenprotected void write(int i)
i - data to be writtenCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.