org.apache.catalina.connector.http
クラス SocketInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.apache.catalina.connector.http.SocketInputStream

public class SocketInputStream
extends java.io.InputStream

Extends InputStream to be more efficient reading lines during HTTP header processing.

作成者:
Remy Maucherat

フィールドの概要
protected  byte[] buf
          Internal buffer.
protected  int count
          Last valid byte.
protected  java.io.InputStream is
          Underlying input stream.
protected  int pos
          Position in the buffer.
protected static StringManager sm
          The string manager for this package.
 
コンストラクタの概要
SocketInputStream(java.io.InputStream is, int bufferSize)
          Construct a servlet input stream associated with the specified socket input.
 
メソッドの概要
 int available()
          Returns the number of bytes that can be read from this input stream without blocking.
 void close()
          Close the input stream.
protected  void fill()
          Fill the internal buffer using data from the undelying input stream.
 int read()
          Read byte.
 void readHeader(org.apache.catalina.connector.http.HttpHeader header)
          Read a header, and copies it to the given buffer.
 void readRequestLine(org.apache.catalina.connector.http.HttpRequestLine requestLine)
          Read the request line, and copies it to the given buffer.
 
クラス java.io.InputStream から継承したメソッド
mark, markSupported, read, read, reset, skip
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

buf

protected byte[] buf
Internal buffer.

count

protected int count
Last valid byte.

pos

protected int pos
Position in the buffer.

is

protected java.io.InputStream is
Underlying input stream.

sm

protected static StringManager sm
The string manager for this package.
コンストラクタの詳細

SocketInputStream

public SocketInputStream(java.io.InputStream is,
                         int bufferSize)
Construct a servlet input stream associated with the specified socket input.
パラメータ:
is - socket input stream
bufferSize - size of the internal buffer
メソッドの詳細

readRequestLine

public void readRequestLine(org.apache.catalina.connector.http.HttpRequestLine requestLine)
                     throws java.io.IOException
Read the request line, and copies it to the given buffer. This function is meant to be used during the HTTP request header parsing. Do NOT attempt to read the request body using it.
パラメータ:
requestLine - Request line object
例外:
java.io.IOException - If an exception occurs during the underlying socket read operations, or if the given buffer is not big enough to accomodate the whole line.

readHeader

public void readHeader(org.apache.catalina.connector.http.HttpHeader header)
                throws java.io.IOException
Read a header, and copies it to the given buffer. This function is meant to be used during the HTTP request header parsing. Do NOT attempt to read the request body using it.
パラメータ:
requestLine - Request line object
例外:
java.io.IOException - If an exception occurs during the underlying socket read operations, or if the given buffer is not big enough to accomodate the whole line.

read

public int read()
         throws java.io.IOException
Read byte.
オーバーライド:
クラス java.io.InputStream 内の read

available

public int available()
              throws java.io.IOException
Returns the number of bytes that can be read from this input stream without blocking.
オーバーライド:
クラス java.io.InputStream 内の available

close

public void close()
           throws java.io.IOException
Close the input stream.
オーバーライド:
クラス java.io.InputStream 内の close

fill

protected void fill()
             throws java.io.IOException
Fill the internal buffer using data from the undelying input stream.


Copyright ? 2000-2001 Apache Software Foundation. All Rights Reserved.