|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Reader org.apache.catalina.connector.InputBuffer
public class InputBuffer
The buffer used by Tomcat request. This is a derivative of the Tomcat 3.3 OutputBuffer, adapted to handle input instead of output. This allows complete recycling of the facade objects (the ServletInputStream and the BufferedReader).
Field Summary | |
---|---|
int |
BYTE_STATE
|
int |
CHAR_STATE
|
protected B2CConverter |
conv
Current byte to char converter. |
static int |
DEFAULT_BUFFER_SIZE
|
static java.lang.String |
DEFAULT_ENCODING
|
protected java.util.Map |
encoders
List of encoders. |
int |
INITIAL_STATE
|
protected static StringManager |
sm
The string manager for this package. |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
InputBuffer()
Default constructor. |
|
InputBuffer(int size)
Alternate constructor which allows specifying the initial buffer size. |
Method Summary | |
---|---|
int |
available()
|
void |
checkConverter()
|
void |
clearEncoders()
Clear cached encoders (to save memory for Comet requests). |
void |
close()
Close the input buffer. |
Request |
getRequest()
Get associated Coyote request. |
void |
mark(int readAheadLimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
int |
read(char[] cbuf)
|
int |
read(char[] cbuf,
int off,
int len)
|
int |
readByte()
|
boolean |
ready()
|
int |
realReadBytes(byte[] cbuf,
int off,
int len)
Reads new bytes in the byte chunk. |
int |
realReadChars(char[] cbuf,
int off,
int len)
Read new bytes ( usually the internal conversion buffer ). |
void |
realWriteChars(char[] c,
int off,
int len)
Since the converter will use append, it is possible to get chars to be removed from the buffer for "writing". |
void |
recycle()
Recycle the output buffer. |
void |
reset()
|
protected void |
setConverter()
|
void |
setEncoding(java.lang.String s)
|
void |
setRequest(Request coyoteRequest)
Associated Coyote request. |
long |
skip(long n)
|
Methods inherited from class java.io.Reader |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static StringManager sm
public static final java.lang.String DEFAULT_ENCODING
public static final int DEFAULT_BUFFER_SIZE
public final int INITIAL_STATE
public final int CHAR_STATE
public final int BYTE_STATE
protected final java.util.Map encoders
protected B2CConverter conv
Constructor Detail |
---|
public InputBuffer()
public InputBuffer(int size)
size
- Buffer size to useMethod Detail |
---|
public void setRequest(Request coyoteRequest)
coyoteRequest
- Associated Coyote requestpublic Request getRequest()
public void recycle()
public void clearEncoders()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Reader
java.io.IOException
- An underlying IOException occurredpublic int available()
public int realReadBytes(byte[] cbuf, int off, int len) throws java.io.IOException
realReadBytes
in interface ByteChunk.ByteInputChannel
cbuf
- Byte buffer to be written to the responseoff
- Offsetlen
- Length
java.io.IOException
- An underlying IOException occurredpublic int readByte() throws java.io.IOException
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public void realWriteChars(char[] c, int off, int len) throws java.io.IOException
realWriteChars
in interface CharChunk.CharOutputChannel
java.io.IOException
public void setEncoding(java.lang.String s)
public int realReadChars(char[] cbuf, int off, int len) throws java.io.IOException
CharChunk.CharInputChannel
realReadChars
in interface CharChunk.CharInputChannel
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] cbuf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.Reader
public void mark(int readAheadLimit) throws java.io.IOException
mark
in class java.io.Reader
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.Reader
java.io.IOException
public void checkConverter() throws java.io.IOException
java.io.IOException
protected void setConverter() throws java.io.IOException
java.io.IOException
|
Apache Tomcat 6.0.53 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |