|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
HTTPClient.RespInputStream
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.
| Field Summary | |
static int |
CD_0
|
static int |
CD_CHUNKED
|
static int |
CD_CLOSE
|
static int |
CD_CONTLEN
|
static int |
CD_HDRS
|
static int |
CD_MP_BR
|
static int |
CD_NONE
Content delimiters |
(package private) boolean |
closed
signals that the user has closed the stream and will therefore not read any further data |
(package private) int |
count
the total number of bytes of entity data read from the demux so far |
static int |
HTTP
possible http protocols we (might) handle |
static int |
HTTP_1_0
some known http versions |
static int |
HTTP_1_1
|
static int |
HTTP_NG
|
static int |
HTTPS
|
static int |
SHTTP
|
| Constructor Summary | |
(package private) |
RespInputStream(StreamDemultiplexor demux,
ResponseHandler resph)
|
| Method Summary | |
int |
available()
gets the number of bytes available for reading without blocking. |
void |
close()
closes the stream. |
(package private) void |
dontTruncate()
Sometime the full response body must be read, i.e. |
protected void |
finalize()
A safety net to clean up. |
int |
read()
Reads a single byte. |
int |
read(byte[] b,
int off,
int len)
Reads len bytes into b, starting at offset off. |
(package private) void |
readAll(int timeout)
Reads all remainings data into buffer. |
long |
skip(long num)
skips num bytes. |
| Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
boolean closed
int count
public static final int HTTP
public static final int HTTPS
public static final int SHTTP
public static final int HTTP_NG
public static final int HTTP_1_0
public static final int HTTP_1_1
public static final int CD_NONE
public static final int CD_HDRS
public static final int CD_0
public static final int CD_CLOSE
public static final int CD_CONTLEN
public static final int CD_CHUNKED
public static final int CD_MP_BR
| Constructor Detail |
RespInputStream(StreamDemultiplexor demux,
ResponseHandler resph)
| Method Detail |
public int read()
throws IOException
IOException - if any exception occured on the connection.
public int read(byte[] b,
int off,
int len)
throws IOException
IOException - if any exception occured on the connection.
public long skip(long num)
throws IOException
IOException - if any exception occured on the connection.
public int available()
throws IOException
IOException - if any exception occured on the connection.
public void close()
throws IOException
if - any exception occured on the connection before or
during close.
IOException
protected void finalize()
throws Throwable
Throwable
void readAll(int timeout)
throws IOException
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.
timeout - the timeout to use for reading from the demux
IOException - If any exception occurs while reading stream.void dontTruncate()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||