public class JoinedInputStream extends InputStream
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.
Constructor and Description |
---|
JoinedInputStream() |
Modifier and Type | Method and Description |
---|---|
JoinedInputStream |
add(InputStream in)
Add another
InputStream . |
void |
close() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
available, mark, markSupported, read, reset, skip
public JoinedInputStream add(InputStream in)
InputStream
.
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.
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
Copyright © 2008–2021. All rights reserved.