| java.lang.Object java.io.InputStream HTTPClient.RespInputStream
RespInputStream | final class RespInputStream extends InputStream implements GlobalConstants(Code) | | This is the InputStream that gets returned to the user. The extensions
consist of the capability to have the data pushed into a buffer if the
stream demux needs to.
version: 0.3-2 18/06/1999 author: Ronald Tschalär since: V0.2 |
Method Summary | |
public synchronized int | available() gets the number of bytes available for reading without blocking. | public synchronized void | close() closes the stream. | synchronized void | dontTruncate() Sometime the full response body must be read, i.e. | protected void | finalize() A safety net to clean up. | public synchronized int | read() Reads a single byte. | public synchronized int | read(byte[] b, int off, int len) Reads len bytes into b, starting at offset
off. | void | readAll(int timeout) Reads all remainings data into buffer. | public synchronized long | skip(long num) skips num bytes. |
closed | boolean closed(Code) | | signals that the user has closed the stream and will therefore
not read any further data
|
count | int count(Code) | | the total number of bytes of entity data read from the demux so far
|
available | public synchronized int available() throws IOException(Code) | | gets the number of bytes available for reading without blocking.
the number of bytes available. exception: IOException - if any exception occured on the connection. |
close | public synchronized void close() throws IOException(Code) | | closes the stream.
if any exception occured on the connection before orduring close. |
dontTruncate | synchronized void dontTruncate()(Code) | | Sometime the full response body must be read, i.e. the connection may
not be closed prematurely (by us). Currently this is needed when the
chunked encoding with trailers is used in a response.
|
finalize | protected void finalize() throws Throwable(Code) | | A safety net to clean up.
|
read | public synchronized int read() throws IOException(Code) | | Reads a single byte.
the byte read, or -1 if EOF. exception: IOException - if any exception occured on the connection. |
read | public synchronized int read(byte[] b, int off, int len) throws IOException(Code) | | Reads len bytes into b, starting at offset
off.
the number of bytes actually read, or -1 if EOF. exception: IOException - if any exception occured on the connection. |
readAll | void readAll(int timeout) throws IOException(Code) | | Reads all remainings data into buffer. This is used to force a read
of upstream responses.
This is probably the most tricky and buggy method around. It's the
only one that really violates the strict top-down method invocation
from the Response through the ResponseStream to the StreamDemultiplexor.
This means we need to be awfully careful about what is synchronized
and what parameters are passed to whom.
Parameters: timeout - the timeout to use for reading from the demux exception: IOException - If any exception occurs while reading stream. |
skip | public synchronized long skip(long num) throws IOException(Code) | | skips num bytes.
the number of bytes actually skipped. exception: IOException - if any exception occured on the connection. |
|
|