Package net.targetr.wtm3.io
Class ChunkedInputStream
java.lang.Object
java.io.InputStream
net.targetr.wtm3.io.ChunkedInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Reads a chunked input stream.
Used by HTTP/1.1 to transfer content of unknown length.
- Author:
- Dr Michael Gardiner
-
Constructor Summary
ConstructorsConstructorDescriptionDecorates an input stream to enable reading in chunks specified by a HTTP/1.1 server. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ChunkedInputStream
Decorates an input stream to enable reading in chunks specified by a HTTP/1.1 server.- Parameters:
in
- The chunked input stream.
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
isFinished
public boolean isFinished()Used to check if all data has bee read from the input stream.- Returns:
- true if there is no more data to read.
-