public class ContinuousInputStream
extends java.io.FilterInputStream
InputStream
wrapper that reads from a queue of underlying InputStream
s, giving the impression that all data is coming from a single,
continuous, source.Modifier | Constructor and Description |
---|---|
protected |
ContinuousInputStream(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addInputStream(java.io.InputStream newIn)
Adds another
InputStream to the InputStream s queue. |
int |
available()
Returns the number of bytes available in the active underlying
InputStream . |
void |
close()
Closes this stream and all underlying
InputStream s. |
int |
read()
Reads one byte from the underlying
InputStream . |
int |
read(byte[] b)
Forwards the read to
read(byte[], int, int) . |
int |
read(byte[] b,
int off,
int len)
Reads bytes from the underlying
InputStream . |
public int available() throws java.io.IOException
InputStream
.available
in class java.io.FilterInputStream
java.io.IOException
FilterInputStream.available()
public void close() throws java.io.IOException
InputStream
s.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterInputStream
java.io.IOException
FilterInputStream.close()
public int read() throws java.io.IOException
InputStream
. When EOF is reached, then reads from the next InputStream
in the queue.read
in class java.io.FilterInputStream
java.io.IOException
FilterInputStream.read()
public int read(byte[] b) throws java.io.IOException
read(byte[], int, int)
.read
in class java.io.FilterInputStream
java.io.IOException
FilterInputStream.read(byte[])
public int read(byte[] b, int off, int len) throws java.io.IOException
InputStream
. When EOF is reached, then reads from the next InputStream
in the queue.read
in class java.io.FilterInputStream
java.io.IOException
FilterInputStream.read(byte[], int, int)
protected boolean addInputStream(java.io.InputStream newIn)
InputStream
to the InputStream
s queue.newIn
- the InputStream
to add.true
if the element was added to the InputStream
s queue.