|
Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Writer
org.apache.catalina.connector.OutputBuffer
public class OutputBuffer
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).
| Field Summary | |
|---|---|
protected C2BConverter |
conv
Current char to byte converter. |
static int |
DEFAULT_BUFFER_SIZE
|
static java.lang.String |
DEFAULT_ENCODING
|
protected java.util.Map |
encoders
List of encoders. |
| Fields inherited from class java.io.Writer |
|---|
lock |
| 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(java.lang.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(char[] c)
|
void |
write(char[] c,
int off,
int len)
|
void |
write(int c)
|
void |
write(java.lang.String s)
|
void |
write(java.lang.String s,
int off,
int len)
Append a string to the buffer |
void |
writeByte(int b)
|
| Methods inherited from class java.io.Writer |
|---|
append, append, append |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_ENCODING
public static final int DEFAULT_BUFFER_SIZE
protected final java.util.Map encoders
protected C2BConverter conv
| Constructor Detail |
|---|
public OutputBuffer()
public OutputBuffer(int size)
size - Buffer size to use| Method Detail |
|---|
public void setResponse(Response coyoteResponse)
coyoteResponse - Associated Coyote responsepublic Response getResponse()
public boolean isSuspended()
public void setSuspended(boolean suspended)
suspended - New suspended flag valuepublic boolean isClosed()
public void recycle()
public void clearEncoders()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.Writerjava.io.IOException - An underlying IOException occurred
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - An underlying IOException occurred
protected void doFlush(boolean realFlush)
throws java.io.IOException
java.io.IOException - An underlying IOException occurred
public void realWriteBytes(byte[] buf,
int off,
int cnt)
throws java.io.IOException
realWriteBytes in interface ByteChunk.ByteOutputChannelbuf - Byte buffer to be written to the responseoff - Offsetcnt - Length
java.io.IOException - An underlying IOException occurred
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOException
public void writeByte(int b)
throws java.io.IOException
java.io.IOException
public void write(int c)
throws java.io.IOException
write in class java.io.Writerjava.io.IOException
public void write(char[] c)
throws java.io.IOException
write in class java.io.Writerjava.io.IOException
public void write(char[] c,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOException
public void write(java.lang.String s,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOException
public void write(java.lang.String s)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void setEncoding(java.lang.String s)
public void checkConverter()
throws java.io.IOException
java.io.IOException
protected void setConverter()
throws java.io.IOException
java.io.IOException
public void flushBytes()
throws java.io.IOException
java.io.IOExceptionpublic int getBytesWritten()
public int getCharsWritten()
public int getContentWritten()
public long getContentWrittenLong()
public boolean isNew()
public void setBufferSize(int size)
public void reset()
public int getBufferSize()
|
Apache Tomcat 6.0.53 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||