final class MultiInputStream
extends java.io.InputStream
InputStream
that concatenates multiple substreams. At most
one stream will be open at a time.Modifier and Type | Field and Description |
---|---|
private java.io.InputStream |
in |
private java.util.Iterator<? extends ByteSource> |
it |
Constructor and Description |
---|
MultiInputStream(java.util.Iterator<? extends ByteSource> it)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
private void |
advance()
Closes the current input stream and opens the next one, if any.
|
int |
available() |
void |
close() |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
private java.util.Iterator<? extends ByteSource> it
private java.io.InputStream in
public MultiInputStream(java.util.Iterator<? extends ByteSource> it) throws java.io.IOException
it
- an iterator of I/O suppliers that will provide each substreamjava.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
private void advance() throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(@Nullable byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException