org.apache.catalina.connector
public class OutputBuffer extends Writer implements ByteChunk.ByteOutputChannel
| Field Summary | |
|---|---|
| protected C2BConverter | conv
Current char to byte converter. |
| static int | DEFAULT_BUFFER_SIZE |
| static String | DEFAULT_ENCODING |
| protected HashMap | encoders
List of encoders. |
| Constructor Summary | |
|---|---|
| OutputBuffer()
Default constructor. | |
| OutputBuffer(int size)
Alternate constructor which allows specifying the initial buffer size.
| |
| Method Summary | |
|---|---|
| void | checkConverter() |
| void | clearEncoders()
Clear cached encoders (to save memory for Comet requests). |
| void | close()
Close the output buffer. |
| protected void | doFlush(boolean realFlush)
Flush bytes or chars contained in the buffer.
|
| void | flush()
Flush bytes or chars contained in the buffer.
|
| void | flushBytes()
Real write - this buffer will be sent to the client |
| int | getBufferSize() |
| int | getBytesWritten() |
| int | getCharsWritten() |
| int | getContentWritten() |
| long | getContentWrittenLong() |
| Response | getResponse()
Get associated Coyote response.
|
| boolean | isClosed()
Is the response output closed ?
|
| boolean | isNew()
True if this buffer hasn't been used ( since recycle() ) -
i.e. no chars or bytes have been added to the buffer. |
| boolean | isSuspended()
Is the response output suspended ?
|
| 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.
|
| void | recycle()
Recycle the output buffer. |
| void | reset() |
| void | setBufferSize(int size) |
| protected void | setConverter() |
| void | setEncoding(String s) |
| void | setResponse(Response coyoteResponse)
Associated Coyote response.
|
| void | setSuspended(boolean suspended)
Set the suspended flag.
|
| void | write(byte[] b, int off, int len) |
| void | write(int c) |
| void | write(char[] c) |
| void | write(char[] c, int off, int len) |
| void | write(String s, int off, int len)
Append a string to the buffer |
| void | write(String s) |
| void | writeByte(int b) |
Parameters: size Buffer size to use
Throws: IOException An underlying IOException occurred
Throws: IOException An underlying IOException occurred
Throws: IOException An underlying IOException occurred
Returns: the associated Coyote response
Returns: closed flag value
Returns: suspended flag value
Parameters: buf Byte buffer to be written to the response off Offset cnt Length
Throws: IOException An underlying IOException occurred
Parameters: coyoteResponse Associated Coyote response
Parameters: suspended New suspended flag value