Module org.elasticsearch.server
Class SlicedInputStream
java.lang.Object
java.io.InputStream
org.elasticsearch.index.snapshots.blobstore.SlicedInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
A
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(int)
is called
if a new slice is required. Each slice is closed once it's been fully consumed or if
close is called before.-
Constructor Summary
ModifierConstructorDescriptionprotected
SlicedInputStream
(int numSlices) Creates a new SlicedInputStream -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
SlicedInputStream
protected SlicedInputStream(int numSlices) Creates a new SlicedInputStream- Parameters:
numSlices
- the number of slices to consume
-
-
Method Details
-
openSlice
Called for each logical slice given a zero based slice ordinal.- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-