public class MultipleInputStream extends InputStream
Instances of this class encapsulate a sequence of input streams.
When one of the streams is exhausted, the multiple stream behaves as if on an end of file.
However, after calling reset() the stream is again readable, and positioned
at the start of the following stream.
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
static InputStream |
getStream(InputStream[] inputStream)
Returns an input stream encapsulating a nonempty array of input streams.
|
static InputStream |
getStream(InputStream[] inputStream,
int offset,
int length)
Returns an input stream encapsulating a nonempty fragment of an array of input streams.
|
boolean |
markSupported() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
markpublic static InputStream getStream(InputStream[] inputStream, int offset, int length)
inputStream - an array of input streams, that will be encapsulated.offset - the first input stream that will be encapsulated.length - the number of input streams to be encapsulated.public static InputStream getStream(InputStream[] inputStream)
Note that if inputStream.length is 1 this method will return the only stream
that should be encapsulated.
inputStream - an array of input streams, that will be encapsulated.public int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStreampublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionCopyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.