@NotThreadSafe public abstract class MultiRangeObjectInputStream extends InputStream
Modifier and Type | Field and Description |
---|---|
protected boolean |
mClosed
Has the stream been closed.
|
protected long |
mEndPos
Position the current stream was open till (exclusive).
|
protected long |
mPos
The current position of the stream.
|
protected InputStream |
mStream
The backing input stream.
|
Modifier | Constructor and Description |
---|---|
protected |
MultiRangeObjectInputStream(long multiRangeChunkSize)
Creates the input stream that will perform reads with a specified chunk size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract InputStream |
createStream(long startPos,
long endPos)
Opens a new stream reading a range.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int offset,
int length) |
long |
skip(long n) |
available, mark, markSupported, reset
protected boolean mClosed
protected InputStream mStream
protected long mPos
protected long mEndPos
protected MultiRangeObjectInputStream(long multiRangeChunkSize)
multiRangeChunkSize
- the chunk size in bytes to read withpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int offset, int length) throws IOException
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
protected abstract InputStream createStream(long startPos, long endPos) throws IOException
startPos
- start position in bytes (inclusive)endPos
- end position in bytes (exclusive)InputStream
IOException
Copyright © 2023. All Rights Reserved.