Package net.sf.basedb.util
Class InputStreamCombiner
java.lang.Object
java.io.InputStream
net.sf.basedb.util.InputStreamCombiner
- All Implemented Interfaces:
Closeable
,AutoCloseable
An input stream implementation that reads one or more input streams
sequentially. When the end of the first stream has been reached, reading
continues on the next one, and so on until all streams have been read.
The underlying streams are automatically closed once they have been fully
read.
- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2010-05-27 10:54:05 +0200 (to, 27 maj 2010) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInputStreamCombiner
(InputStream... in) Create a new stream combiner using the given streams to read from -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Field Details
-
in
-
index
private int index
-
-
Constructor Details
-
InputStreamCombiner
Create a new stream combiner using the given streams to read from- Parameters:
in
- The stream to read from, must be an array with at least one stream
-
-
Method Details
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
Closes all underlying streams.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
nextStream
private void nextStream()
-