public class ChunkedInputStream
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.io.InputStream |
is |
protected boolean |
isClosed |
Constructor and Description |
---|
ChunkedInputStream(java.io.InputStream stream)
Wraps an input stream and interprets it as a chunked stream.
|
ChunkedInputStream(java.io.InputStream stream,
ChunkProtocol chunkProtocol)
Wraps an input stream and interprets it as a chunked stream.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
int |
availableInChunk() |
void |
close() |
int |
getChunkedReadBufferSize() |
int |
getCurrentChunkType() |
boolean |
isLastChunk() |
boolean |
readChunkedMessage(java.io.OutputStream dStream,
java.io.OutputStream errStream)
Reads a chunked message from the underlying InputStream and transmits to the passed OutputStream,
dstream . |
int |
readChunkHeader()
Reads the next chunk header.
|
public ChunkedInputStream(java.io.InputStream stream, ChunkProtocol chunkProtocol)
stream
- to wrapchunkProtocol
- the chunking protocolpublic ChunkedInputStream(java.io.InputStream stream)
stream
- to wrappublic int readChunkHeader() throws java.io.IOException
java.io.IOException
- When the underlying stream does, or if the header is boguspublic int getCurrentChunkType()
public int availableInChunk()
public int available() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public boolean isLastChunk()
public boolean readChunkedMessage(java.io.OutputStream dStream, java.io.OutputStream errStream) throws java.io.IOException
dstream
. If an error condition is encountered in the chunked message then the error content
will be written to the OutputStream errStream
.dStream
- The stream into which to transfer the message data.errStream
- The stream into which to transfer error content if the
message contains it.java.io.IOException
- When there are problems reading from or interpreting
the chunked message stream.public int getChunkedReadBufferSize()