Package de.pdark.decentxml
Class JoinedInputStream
java.lang.Object
java.io.InputStream
de.pdark.decentxml.JoinedInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This class allows to join several
InputStream's into one.
Reading from an instance of JoinedInputStream will read each underlying
InputStream until it is depleted and then continue with the next one.
Depleted InputStream's will be closed as soon as possible.
- Author:
- digulla
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(InputStream in) Add anotherInputStream.voidclose()intread()intread(byte[] b, int off, int len) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
JoinedInputStream
public JoinedInputStream()
-
-
Method Details
-
add
Add anotherInputStream.It is allowed to add more
InputStream's even after reading has started.It is illegal to add more streams after the joined stream has been closed.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-