|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
it.unimi.dsi.io.MultipleInputStream
public class MultipleInputStream
A multiple input stream.
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.
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.io.InputStream |
|---|
mark |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
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 InputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOExceptionpublic boolean markSupported()
markSupported in class InputStream
public int read()
throws IOException
read in class InputStreamIOException
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
public int read(byte[] b)
throws IOException
read in class InputStreamIOException
public void reset()
throws IOException
reset in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||