Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » coyote » http11 » [javadoc | source]
org.apache.coyote.http11
public class: InternalInputBuffer [javadoc | source]
java.lang.Object
   org.apache.coyote.http11.InternalInputBuffer

All Implemented Interfaces:
    InputBuffer

Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.
Nested Class Summary:
protected class  InternalInputBuffer.InputStreamInputBuffer  This class is an input buffer which will read its data from an input stream. 
Field Summary
protected static  StringManager sm    The string manager for this package. 
protected  Request request    Associated Coyote request. 
protected  MimeHeaders headers    Headers of the associated request. 
protected  boolean parsingHeader    State. 
protected  boolean swallowInput    Swallow input ? (in the case of an expectation) 
protected  byte[] buf    Pointer to the current read buffer. 
protected  int lastValid    Last valid byte. 
protected  int pos    Position in the buffer. 
protected  int end    Pos of the end of the header in the buffer, which is also the start of the body. 
protected  InputStream inputStream    Underlying input stream. 
protected  InputBuffer inputStreamInputBuffer    Underlying input buffer. 
protected  InputFilter[] filterLibrary    Filter library. Note: Filter[0] is always the "chunked" filter. 
protected  InputFilter[] activeFilters    Active filters (in order). 
protected  int lastActiveFilter    Index of the last active filter. 
Constructor:
 public InternalInputBuffer(Request request) 
    Default constructor.
 public InternalInputBuffer(Request request,
    int headerBufferSize) 
    Alternate constructor.
Method from org.apache.coyote.http11.InternalInputBuffer Summary:
addActiveFilter,   addFilter,   clearFilters,   doRead,   endRequest,   fill,   getFilters,   getInputStream,   nextRequest,   parseHeader,   parseHeaders,   parseRequestLine,   recycle,   setInputStream,   setSwallowInput
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.coyote.http11.InternalInputBuffer Detail:
 public  void addActiveFilter(InputFilter filter) 
    Add an input filter to the filter library.
 public  void addFilter(InputFilter filter) 
    Add an input filter to the filter library.
 public  void clearFilters() 
    Clear filters.
 public int doRead(ByteChunk chunk,
    Request req) throws IOException 
    Read some bytes.
 public  void endRequest() throws IOException 
    End request (consumes leftover bytes).
 protected boolean fill() throws IOException 
    Fill the internal buffer using data from the undelying input stream.
 public InputFilter[] getFilters() 
    Get filters.
 public InputStream getInputStream() 
    Get the underlying socket input stream.
 public  void nextRequest() 
    End processing of current HTTP request. Note: All bytes of the current request should have been already consumed. This method only resets all the pointers so that we are ready to parse the next HTTP request.
 public boolean parseHeader() throws IOException 
    Parse an HTTP header.
 public  void parseHeaders() throws IOException 
    Parse the HTTP headers.
 public  void parseRequestLine() throws IOException 
    Read the request line. This function is meant to be used during the HTTP request header parsing. Do NOT attempt to read the request body using it.
 public  void recycle() 
    Recycle the input buffer. This should be called when closing the connection.
 public  void setInputStream(InputStream inputStream) 
    Set the underlying socket input stream.
 public  void setSwallowInput(boolean swallowInput) 
    Set the swallow input flag.