| java.lang.Object java.io.Writer org.apache.catalina.connector.OutputBuffer
OutputBuffer | public class OutputBuffer extends Writer implements ByteChunk.ByteOutputChannel(Code) | | The buffer used by Tomcat response. This is a derivative of the Tomcat 3.3
OutputBuffer, with the removal of some of the state handling (which in
Coyote is mostly the Processor's responsability).
author: Costin Manolache author: Remy Maucherat |
Constructor Summary | |
public | OutputBuffer() Default constructor. | public | OutputBuffer(int size) Alternate constructor which allows specifying the initial buffer size. |
DEFAULT_BUFFER_SIZE | final public static int DEFAULT_BUFFER_SIZE(Code) | | |
DEFAULT_ENCODING | final public static String DEFAULT_ENCODING(Code) | | |
OutputBuffer | public OutputBuffer()(Code) | | Default constructor. Allocate the buffer with the default buffer size.
|
OutputBuffer | public OutputBuffer(int size)(Code) | | Alternate constructor which allows specifying the initial buffer size.
Parameters: size - Buffer size to use |
clearEncoders | public void clearEncoders()(Code) | | Clear cached encoders (to save memory for Comet requests).
|
close | public void close() throws IOException(Code) | | Close the output buffer. This tries to calculate the response size if
the response has not been committed yet.
throws: IOException - An underlying IOException occurred |
doFlush | protected void doFlush(boolean realFlush) throws IOException(Code) | | Flush bytes or chars contained in the buffer.
throws: IOException - An underlying IOException occurred |
flush | public void flush() throws IOException(Code) | | Flush bytes or chars contained in the buffer.
throws: IOException - An underlying IOException occurred |
flushBytes | public void flushBytes() throws IOException(Code) | | Real write - this buffer will be sent to the client
|
getBufferSize | public int getBufferSize()(Code) | | |
getBytesWritten | public int getBytesWritten()(Code) | | |
getCharsWritten | public int getCharsWritten()(Code) | | |
getContentWritten | public int getContentWritten()(Code) | | |
getResponse | public Response getResponse()(Code) | | Get associated Coyote response.
the associated Coyote response |
isClosed | public boolean isClosed()(Code) | | Is the response output closed ?
closed flag value |
isNew | public boolean isNew()(Code) | | True if this buffer hasn't been used ( since recycle() ) -
i.e. no chars or bytes have been added to the buffer.
|
isSuspended | public boolean isSuspended()(Code) | | Is the response output suspended ?
suspended flag value |
realWriteBytes | public void realWriteBytes(byte buf, int off, int cnt) throws IOException(Code) | | Sends the buffer data to the client output, checking the
state of Response and calling the right interceptors.
Parameters: buf - Byte buffer to be written to the response Parameters: off - Offset Parameters: cnt - Length throws: IOException - An underlying IOException occurred |
recycle | public void recycle()(Code) | | Recycle the output buffer.
|
reset | public void reset()(Code) | | |
setBufferSize | public void setBufferSize(int size)(Code) | | |
setResponse | public void setResponse(Response coyoteResponse)(Code) | | Associated Coyote response.
Parameters: coyoteResponse - Associated Coyote response |
setSuspended | public void setSuspended(boolean suspended)(Code) | | Set the suspended flag.
Parameters: suspended - New suspended flag value |
|
|