| java.lang.Object java.io.InputStream org.apache.catalina.connector.http.SocketInputStream
SocketInputStream | public class SocketInputStream extends InputStream (Code) | | Extends InputStream to be more efficient reading lines during HTTP
header processing.
author: Remy Maucherat |
Field Summary | |
protected byte | buf Internal buffer. | protected int | count Last valid byte. | protected InputStream | is Underlying input stream. | protected int | pos Position in the buffer. | protected static StringManager | sm The string manager for this package. |
Constructor Summary | |
public | SocketInputStream(InputStream is, int bufferSize) Construct a servlet input stream associated with the specified socket
input. |
Method Summary | |
public int | available() Returns the number of bytes that can be read from this input
stream without blocking. | public void | close() Close the input stream. | protected void | fill() Fill the internal buffer using data from the undelying input stream. | public int | read() Read byte. | public void | readHeader(HttpHeader header) Read a header, and copies it to the given buffer. | public void | readRequestLine(HttpRequestLine requestLine) Read the request line, and copies it to the given buffer. |
buf | protected byte buf(Code) | | Internal buffer.
|
count | protected int count(Code) | | Last valid byte.
|
pos | protected int pos(Code) | | Position in the buffer.
|
SocketInputStream | public SocketInputStream(InputStream is, int bufferSize)(Code) | | Construct a servlet input stream associated with the specified socket
input.
Parameters: is - socket input stream Parameters: bufferSize - size of the internal buffer |
available | public int available() throws IOException(Code) | | Returns the number of bytes that can be read from this input
stream without blocking.
|
fill | protected void fill() throws IOException(Code) | | Fill the internal buffer using data from the undelying input stream.
|
readHeader | public void readHeader(HttpHeader header) throws IOException(Code) | | 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.
Parameters: requestLine - Request line object throws: IOException - If an exception occurs during the underlying socketread operations, or if the given buffer is not big enough to accomodatethe whole line. |
readRequestLine | public void readRequestLine(HttpRequestLine requestLine) throws IOException(Code) | | 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.
Parameters: requestLine - Request line object throws: IOException - If an exception occurs during the underlying socketread operations, or if the given buffer is not big enough to accomodatethe whole line. |
|
|