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) |
mark
public 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 InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public boolean markSupported()
markSupported
in class InputStream
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 int read(byte[] b) throws IOException
read
in class InputStream
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.