| java.lang.Object java.io.InputStream javax.servlet.ServletInputStream org.apache.catalina.connector.RequestStream
All known Subclasses: org.apache.catalina.connector.http.HttpRequestStream,
RequestStream | public class RequestStream extends ServletInputStream (Code) | | Convenience implementation of ServletInputStream that works with
the standard implementations of Request. If the content length has
been set on our associated Request, this implementation will enforce
not reading more than that many bytes on the underlying stream.
author: Craig R. McClanahan version: $Revision: 1.6 $ $Date: 2002/03/18 07:15:39 $ |
Field Summary | |
protected boolean | closed | protected int | count The number of bytes which have already been returned by this stream. | protected int | length The content length past which we will not read, or -1 if there is
no defined content length. | protected static StringManager | sm The localized strings for this package. | protected InputStream | stream The underlying input stream from which we should read data. |
Constructor Summary | |
public | RequestStream(Request request) Construct a servlet input stream associated with the specified Request. |
Method Summary | |
public void | close() Close this input stream. | public int | read() Read and return a single byte from this input stream, or -1 if end of
file has been encountered. | public int | read(byte b) Read some number of bytes from the input stream, and store them
into the buffer array b. | public int | read(byte b, int off, int len) Read up to len bytes of data from the input stream
into an array of bytes. |
closed | protected boolean closed(Code) | | Has this stream been closed?
|
count | protected int count(Code) | | The number of bytes which have already been returned by this stream.
|
length | protected int length(Code) | | The content length past which we will not read, or -1 if there is
no defined content length.
|
stream | protected InputStream stream(Code) | | The underlying input stream from which we should read data.
|
RequestStream | public RequestStream(Request request)(Code) | | Construct a servlet input stream associated with the specified Request.
Parameters: request - The associated request |
close | public void close() throws IOException(Code) | | Close this input stream. No physical level I-O is performed, but
any further attempt to read from this stream will throw an IOException.
If a content length has been set but not all of the bytes have yet been
consumed, the remaining bytes will be swallowed.
|
read | public int read() throws IOException(Code) | | Read and return a single byte from this input stream, or -1 if end of
file has been encountered.
exception: IOException - if an input/output error occurs |
read | public int read(byte b) throws IOException(Code) | | Read some number of bytes from the input stream, and store them
into the buffer array b. The number of bytes actually read is
returned as an integer. This method blocks until input data is
available, end of file is detected, or an exception is thrown.
Parameters: b - The buffer into which the data is read exception: IOException - if an input/output error occurs |
read | public int read(byte b, int off, int len) throws IOException(Code) | | Read up to len bytes of data from the input stream
into an array of bytes. An attempt is made to read as many as
len bytes, but a smaller number may be read,
possibly zero. The number of bytes actually read is returned as
an integer. This method blocks until input data is available,
end of file is detected, or an exception is thrown.
Parameters: b - The buffer into which the data is read Parameters: off - The start offset into array b at whichthe data is written Parameters: len - The maximum number of bytes to read exception: IOException - if an input/output error occurs |
Methods inherited from javax.servlet.ServletInputStream | public int readLine(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
|
|
|