Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » connector » [javadoc | source]
org.apache.catalina.connector
public class: InputBuffer [javadoc | source]
java.lang.Object
   java.io.Reader
      org.apache.catalina.connector.InputBuffer

All Implemented Interfaces:
    CharOutputChannel, ByteInputChannel, CharInputChannel, Closeable, Readable

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
public static final  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  HashMap encoders    List of encoders. 
protected  B2CConverter conv    Current byte to char converter. 
Constructor:
 public InputBuffer() 
 public InputBuffer(int size) 
Method from org.apache.catalina.connector.InputBuffer Summary:
available,   checkConverter,   clearEncoders,   close,   getRequest,   mark,   markSupported,   read,   read,   read,   read,   readByte,   ready,   realReadBytes,   realReadChars,   realWriteChars,   recycle,   reset,   setConverter,   setEncoding,   setRequest,   skip
Methods from java.io.Reader:
close,   mark,   markSupported,   read,   read,   read,   read,   ready,   reset,   skip
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.connector.InputBuffer Detail:
 public int available() 
 public  void checkConverter() throws IOException 
 public  void clearEncoders() 
    Clear cached encoders (to save memory for Comet requests).
 public  void close() throws IOException 
    Close the input buffer.
 public Request getRequest() 
    Get associated Coyote request.
 public  void mark(int readAheadLimit) throws IOException 
 public boolean markSupported() 
 public int read() throws IOException 
 public int read(char[] cbuf) throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException 
 public int read(char[] cbuf,
    int off,
    int len) throws IOException 
 public int readByte() throws IOException 
 public boolean ready() throws IOException 
 public int realReadBytes(byte[] cbuf,
    int off,
    int len) throws IOException 
    Reads new bytes in the byte chunk.
 public int realReadChars(char[] cbuf,
    int off,
    int len) throws IOException 
 public  void realWriteChars(char[] c,
    int off,
    int len) throws IOException 
    Since the converter will use append, it is possible to get chars to be removed from the buffer for "writing". Since the chars have already been read before, they are ignored. If a mark was set, then the mark is lost.
 public  void recycle() 
    Recycle the output buffer.
 public  void reset() throws IOException 
 protected  void setConverter() throws IOException 
 public  void setEncoding(String s) 
 public  void setRequest(Request coyoteRequest) 
    Associated Coyote request.
 public long skip(long n) throws IOException