|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
org.apache.commons.httpclient.AutoCloseInputStream
Closes an underlying stream as soon as the end of the stream is reached, and notifies a client when it has done so.
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
AutoCloseInputStream(java.io.InputStream in,
ResponseConsumedWatcher watcher)
Create a new auto closing stream for the provided connection |
Method Summary | |
void |
close()
Close the stream, and also close the underlying stream if it is not already closed. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b)
Reads some number of bytes from the input stream and stores them into the buffer array b. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from the stream. |
Methods inherited from class java.io.FilterInputStream |
available, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AutoCloseInputStream(java.io.InputStream in, ResponseConsumedWatcher watcher)
in
- the input stream to read fromwatcher
- To be notified when the contents of the stream have been
consumed.Method Detail |
public int read() throws java.io.IOException
java.io.IOException
- when there is an error readingpublic int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes of data from the stream.
b
- a byte
array to read data intooff
- an offset within the array to store datalen
- the maximum number of bytes to read
java.io.IOException
- if there are errors readingpublic int read(byte[] b) throws java.io.IOException
b
- a byte
array to read data into
java.io.IOException
- if there are errors readingpublic void close() throws java.io.IOException
java.io.IOException
- If an IO problem occurs.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |