Package de.pdark.decentxml
Class JoinedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- de.pdark.decentxml.JoinedInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class JoinedInputStream extends InputStream
This class allows to join severalInputStream's into one.Reading from an instance of
JoinedInputStreamwill read each underlyingInputStreamuntil 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 Constructor Description JoinedInputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoinedInputStreamadd(InputStream in)Add anotherInputStream.voidclose()intread()intread(byte[] b, int off, int len)-
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
-
-
-
-
Method Detail
-
add
public JoinedInputStream add(InputStream in)
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
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-