public class ContinuousInputStream
extends java.io.FilterInputStream
InputStream wrapper that reads from a queue of underlying InputStreams, 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 InputStreams queue. |
int |
available()
Returns the number of bytes available in the active underlying
InputStream. |
void |
close()
Closes this stream and all underlying
InputStreams. |
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.FilterInputStreamjava.io.IOExceptionFilterInputStream.available()public void close()
throws java.io.IOException
InputStreams.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOExceptionFilterInputStream.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.FilterInputStreamjava.io.IOExceptionFilterInputStream.read()public int read(byte[] b)
throws java.io.IOException
read(byte[], int, int).read in class java.io.FilterInputStreamjava.io.IOExceptionFilterInputStream.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.FilterInputStreamjava.io.IOExceptionFilterInputStream.read(byte[], int, int)protected boolean addInputStream(java.io.InputStream newIn)
InputStream to the InputStreams queue.newIn - the InputStream to add.true if the element was added to the InputStreams queue.