Package nl.vpro.util
Class InputStreamChunk
- java.lang.Object
-
- java.io.InputStream
-
- nl.vpro.util.InputStreamChunk
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Counted
public class InputStreamChunk extends InputStream implements Counted
Wraps anInputStream
to limit the number of bytes to produces.Never closes the underlying stream.
- Since:
- 3.4
- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Constructor Description InputStreamChunk(int chunkSize, InputStream wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getCount()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
InputStreamChunk
public InputStreamChunk(int chunkSize, InputStream wrapped)
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
-