org.apache.commons.httpclient
Class ResponseInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.apache.commons.httpclient.ResponseInputStream

Deprecated. Use new ChunkedInputStream(HttpConnecion#getResponseInputStream());

public class ResponseInputStream
extends InputStream

InputStream wrapper supporting the chunked transfer encoding.

Version:
$Revision: 1.23.2.1 $ $Date: 2004/02/22 18:21:13 $
Author:
Remy Maucherat, Sean C. Sullivan, dIon Gillard, Mike Bowler

Field Summary
static Log LOG
          Deprecated. Log object for this class.
 
Constructor Summary
ResponseInputStream(InputStream stream, boolean chunked, int contentLength)
          Deprecated. Use ChunkedInputStream;
ResponseInputStream(InputStream stream, HttpMethod method)
          Deprecated. Use ChunkedInputStream;
 
Method Summary
 void close()
          Deprecated. Use ChunkedInputStream;
 int read()
          Deprecated. Use ChunkedInputStream;
 int read(byte[] b, int off, int len)
          Deprecated. Use ChunkedInputStream;
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final Log LOG
Deprecated. 
Log object for this class.
Constructor Detail

ResponseInputStream

public ResponseInputStream(InputStream stream,
                           boolean chunked,
                           int contentLength)
Deprecated. Use ChunkedInputStream;

Parameters:
stream - Must be non-null.
chunked - true if the input stream is chunked
contentLength - content length

ResponseInputStream

public ResponseInputStream(InputStream stream,
                           HttpMethod method)
Deprecated. Use ChunkedInputStream;

Construct a servlet input stream associated with the specified Request.
Parameters:
stream - Must be non-null.
method - Must be non-null.
Method Detail

close

public void close()
           throws IOException
Deprecated. Use ChunkedInputStream;

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.
Overrides:
close in class InputStream
Throws:
IOException - If an IO problem occurs.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Deprecated. Use ChunkedInputStream;

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.
Overrides:
read in class InputStream
Parameters:
b - The buffer into which the data is read
off - The start offset into array b at which the data is written
len - The maximum number of bytes to read
Returns:
The number of bytes that were read.
Throws:
IOException - if an input/output error occurs

read

public int read()
         throws IOException
Deprecated. Use ChunkedInputStream;

Read and return a single byte from this input stream, or -1 if end of file has been encountered.
Overrides:
read in class InputStream
Returns:
The next byte in the stream or -1.
Throws:
IOException - if an input/output error occurs


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.