|
||||||||||
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 | +--org.mortbay.http.HttpInputStream
HTTP Chunking InputStream. This FilterInputStream acts as a BufferedInputStream until setChunking(true) is called. Once chunking is enabled, the raw stream is chunk decoded as per RFC2616. The "8859-1" encoding is used on underlying LineInput instance for line based reads from the raw stream. This class is not synchronized and should be synchronized explicitly if an instance is used by multiple threads.
LineInput
Constructor Summary | |
HttpInputStream(java.io.InputStream in)
Constructor. |
|
HttpInputStream(java.io.InputStream in,
int bufferSize)
Constructor. |
Method Summary | |
void |
close()
|
void |
destroy()
|
int |
getContentLength()
Get the content length. |
java.io.InputStream |
getFilterStream()
Get Filter InputStream. |
java.io.InputStream |
getInputStream()
Get the raw stream. |
HttpFields |
getTrailer()
|
boolean |
isChunking()
Get chunking mode |
void |
resetStream()
Reset the stream. |
void |
setChunking()
Set chunking mode. |
void |
setContentLength(int len)
Set the content length. |
void |
setFilterStream(java.io.InputStream filter)
Set Filter InputStream. |
Methods inherited from class java.io.FilterInputStream |
available, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HttpInputStream(java.io.InputStream in)
public HttpInputStream(java.io.InputStream in, int bufferSize)
Method Detail |
public java.io.InputStream getInputStream()
public java.io.InputStream getFilterStream()
public void setFilterStream(java.io.InputStream filter)
public boolean isChunking()
public void setChunking() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- Checking cannot be set if
a content length has been set.public void resetStream() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The stream cannot be reset if
there is some unread chunked input or a content length greater
than zero remaining.public void close() throws java.io.IOException
close
in class java.io.FilterInputStream
java.io.IOException
public void setContentLength(int len)
len
- length.public int getContentLength()
public HttpFields getTrailer()
public void destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |