|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.FilterInputStream | +--java.io.DataInputStream | +--rabbit.io.HTTPInputStream
This is an extended DataInputStream suitable for reading data from the web. It handles chunked encoding etc. If the underlying input is chunked this class will throw away any trailing footer.
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
HTTPInputStream(java.io.InputStream is)
Create a new HTTPInputStream on the underlying stream. |
Method Summary | |
boolean |
chunked()
Get the chunked value. |
void |
close()
|
long |
dataSize()
Get the size of the page being read. |
protected void |
finish()
|
protected int |
getChunkSize()
Get the size of the next chunk. |
java.io.InputStream |
getChunkStream()
Get the chunked page. |
boolean |
getKeepAlive()
Get the keep alive value. |
void |
readCRLF()
Read of an CR LF combination. |
HTTPHeader |
readHTTPHeader()
Read a HTTPHeader of this stream. |
void |
setKeepAlive(boolean keepalive)
Set the keep alive value to currentkeepalive & keepalive |
Methods inherited from class java.io.DataInputStream |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes |
Methods inherited from class java.io.FilterInputStream |
available, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HTTPInputStream(java.io.InputStream is)
is
- the underlying streamMethod Detail |
public HTTPHeader readHTTPHeader() throws java.io.IOException
java.io.IOException
- if the HTTPHeader could not be read correctly.public boolean getKeepAlive()
public void setKeepAlive(boolean keepalive)
keepalive
- the new keepalive value.public boolean chunked()
public long dataSize()
protected int getChunkSize() throws java.io.IOException
java.io.IOException
- if the chunk size could not be read correctly.public void readCRLF() throws java.io.IOException
java.io.IOException
- if the CR LF combination could not be read correctly.public java.io.InputStream getChunkStream()
protected void finish()
public void close() throws java.io.IOException
close
in class java.io.FilterInputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |