public abstract class SlicedInputStream
extends java.io.InputStream
SlicedInputStream is a logical
concatenation one or more input streams. In contrast to the JDKs
SequenceInputStream this stream doesn't require the instantiation
of all logical sub-streams ahead of time. Instead, openSlice(long) is called
if a new slice is required. Each slice is closed once it's been fully consumed or if
close is called before.| Modifier | Constructor | Description |
|---|---|---|
protected |
SlicedInputStream(long numSlices) |
Creates a new SlicedInputStream
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
|
void |
close() |
|
protected abstract java.io.InputStream |
openSlice(long slice) |
Called for each logical slice given a zero based slice ordinal.
|
int |
read() |
|
int |
read(byte[] buffer,
int offset,
int length) |
protected SlicedInputStream(long numSlices)
numSlices - the number of slices to consumeprotected abstract java.io.InputStream openSlice(long slice)
throws java.io.IOException
java.io.IOExceptionpublic final int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic final int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic final void close()
throws java.io.IOException
close in class java.io.InputStreamjava.io.IOExceptionpublic final int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOException