Apache Tomcat 7.0.4

org.apache.coyote.http11
Class InternalInputBuffer

java.lang.Object
  extended by org.apache.coyote.http11.AbstractInputBuffer
      extended by org.apache.coyote.http11.InternalInputBuffer
All Implemented Interfaces:
InputBuffer

public class InternalInputBuffer
extends AbstractInputBuffer

Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.

Author:
Remy Maucherat

Nested Class Summary
protected  class InternalInputBuffer.InputStreamInputBuffer
          This class is an input buffer which will read its data from an input stream.
 
Field Summary
 
Fields inherited from class org.apache.coyote.http11.AbstractInputBuffer
activeFilters, buf, end, filterLibrary, headers, inputStream, inputStreamInputBuffer, lastActiveFilter, lastValid, parsingHeader, pos, request, sm, swallowInput
 
Constructor Summary
InternalInputBuffer(Request request)
          Default constructor.
InternalInputBuffer(Request request, int headerBufferSize)
          Alternate constructor.
 
Method Summary
protected  boolean fill()
          Fill the internal buffer using data from the underlying input stream.
protected  boolean fill(boolean block)
           
 boolean parseHeader()
          Parse an HTTP header.
 boolean parseHeaders()
          Parse the HTTP headers.
 boolean parseRequestLine(boolean useAvailableDataOnly)
          Read the request line.
 
Methods inherited from class org.apache.coyote.http11.AbstractInputBuffer
addActiveFilter, addFilter, clearFilters, doRead, endRequest, getFilters, getInputStream, nextRequest, recycle, setInputStream, setSwallowInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalInputBuffer

public InternalInputBuffer(Request request)
Default constructor.


InternalInputBuffer

public InternalInputBuffer(Request request,
                           int headerBufferSize)
Alternate constructor.

Method Detail

parseRequestLine

public boolean parseRequestLine(boolean useAvailableDataOnly)
                         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.

Specified by:
parseRequestLine in class AbstractInputBuffer
Throws:
IOException - If an exception occurs during the underlying socket read operations, or if the given buffer is not big enough to accommodate the whole line.

parseHeaders

public boolean parseHeaders()
                     throws IOException
Parse the HTTP headers.

Specified by:
parseHeaders in class AbstractInputBuffer
Throws:
IOException

parseHeader

public boolean parseHeader()
                    throws IOException
Parse an HTTP header.

Returns:
false after reading a blank line (which indicates that the HTTP header parsing is done
Throws:
IOException

fill

protected boolean fill()
                throws IOException
Fill the internal buffer using data from the underlying input stream.

Returns:
false if at end of stream
Throws:
IOException

fill

protected boolean fill(boolean block)
                throws IOException
Specified by:
fill in class AbstractInputBuffer
Throws:
IOException

Apache Tomcat 7.0.4

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.