| java.lang.Object java.io.Writer org.apache.coyote.tomcat4.OutputBuffer
OutputBuffer | public class OutputBuffer extends Writer implements ByteChunk.ByteOutputChannel,CharChunk.CharOutputChannel(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. |
Method Summary | |
public void | close() Close the output buffer. | protected void | doFlush(boolean realFlush) Flush bytes or chars contained in the buffer. | public void | flush() Flush bytes or chars contained in the buffer. | public void | flushBytes() | public void | flushChars() | public boolean | flushCharsNeeded() | public int | getBufferSize() | public int | getBytesWritten() | public int | getCharsWritten() | public int | getContentWritten() | public Response | getResponse() Get associated Coyote response. | public boolean | isNew() True if this buffer hasn't been used ( since recycle() ) -
i.e. | public boolean | isSuspended() | protected void | log(String s) | public void | realWriteBytes(byte buf, int off, int cnt) Sends the buffer data to the client output, checking the
state of Response and calling the right interceptors. | public void | realWriteChars(char c, int off, int len) | public void | recycle() Recycle the output buffer. | public void | reset() | public void | setBufferSize(int size) | protected void | setConverter() | public void | setEncoding(String s) | public void | setResponse(Response coyoteResponse) Associated Coyote response. | public void | setSuspended(boolean suspended) Set the suspended flag. | public void | write(byte b, int off, int len) | public void | write(int c) | public void | write(char c) | public void | write(char c, int off, int len) | public void | write(StringBuffer sb) | public void | write(String s, int off, int len) | public void | write(String s) | public void | writeByte(int b) |
BYTE_STATE | final public int BYTE_STATE(Code) | | |
CHAR_STATE | final public int CHAR_STATE(Code) | | |
DEFAULT_BUFFER_SIZE | final public static int DEFAULT_BUFFER_SIZE(Code) | | |
DEFAULT_ENCODING | final public static String DEFAULT_ENCODING(Code) | | |
INITIAL_STATE | final public int INITIAL_STATE(Code) | | |
debug | final static int debug(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 |
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
|
flushCharsNeeded | public boolean flushCharsNeeded()(Code) | | |
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 |
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 |
realWriteChars | public void realWriteChars(char c, int off, int len) throws IOException(Code) | | |
recycle | public void recycle()(Code) | | Recycle the output buffer.
|
reset | public void reset()(Code) | | |
setBufferSize | public void setBufferSize(int size)(Code) | | |
setConverter | protected void setConverter()(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 |
|
|