|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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 responsibility).
Field Summary | |
---|---|
protected C2BConverter |
conv
Current char to byte converter. |
static int |
DEFAULT_BUFFER_SIZE
|
static String |
DEFAULT_ENCODING
|
protected HashMap<String,C2BConverter> |
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. |
int |
getBufferSize()
|
long |
getContentWritten()
|
Response |
getResponse()
Deprecated. |
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 |
reset(boolean resetWriterStreamFlags)
|
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(char[] c)
|
void |
write(char[] c,
int off,
int len)
|
void |
write(int c)
|
void |
write(String s)
|
void |
write(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 String DEFAULT_ENCODING
public static final int DEFAULT_BUFFER_SIZE
protected HashMap<String,C2BConverter> encoders
protected C2BConverter conv
Constructor Detail |
---|
public OutputBuffer()
public OutputBuffer(int size)
size
- Buffer size to useMethod Detail |
---|
public void setResponse(Response coyoteResponse)
coyoteResponse
- Associated Coyote response@Deprecated public 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 IOException
close
in interface Closeable
close
in class Writer
IOException
- An underlying IOException occurredpublic void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
- An underlying IOException occurredprotected void doFlush(boolean realFlush) throws IOException
IOException
- An underlying IOException occurredpublic void realWriteBytes(byte[] buf, int off, int cnt) throws IOException
realWriteBytes
in interface ByteChunk.ByteOutputChannel
buf
- Byte buffer to be written to the responseoff
- Offsetcnt
- Length
IOException
- An underlying IOException occurredpublic void write(byte[] b, int off, int len) throws IOException
IOException
public void writeByte(int b) throws IOException
IOException
public void write(int c) throws IOException
write
in class Writer
IOException
public void write(char[] c) throws IOException
write
in class Writer
IOException
public void write(char[] c, int off, int len) throws IOException
write
in class Writer
IOException
public void write(String s, int off, int len) throws IOException
write
in class Writer
IOException
public void write(String s) throws IOException
write
in class Writer
IOException
public void setEncoding(String s)
public void checkConverter() throws IOException
IOException
protected void setConverter() throws IOException
IOException
public long getContentWritten()
public boolean isNew()
public void setBufferSize(int size)
public void reset()
public void reset(boolean resetWriterStreamFlags)
public int getBufferSize()
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |