public final class InputSubstream extends SdkFilterInputStream
Modifier and Type | Field and Description |
---|---|
private boolean |
closeSourceStream |
private long |
currentPosition |
private long |
markedPosition |
private static int |
MAX_SKIPS |
private long |
requestedLength |
private long |
requestedOffset |
Constructor and Description |
---|
InputSubstream(java.io.InputStream in,
long offset,
long length,
boolean closeSourceStream)
Constructs a new InputSubstream so that when callers start reading from
this stream they'll start at the specified offset in the real stream and
after they've read the specified length, this stream will look empty.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
(package private) java.io.InputStream |
getWrappedInputStream()
Strictly used for testing only.
|
void |
mark(int readlimit) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
abort, abortIfNeeded, isMetricActivated, markSupported, release, skip
private static final int MAX_SKIPS
private long currentPosition
private final long requestedOffset
private final long requestedLength
private final boolean closeSourceStream
private long markedPosition
public InputSubstream(java.io.InputStream in, long offset, long length, boolean closeSourceStream)
in
- The input stream to wrap.offset
- The offset, in bytes, into the specified input stream at which
to start reading data.length
- The length, in bytes, of the specified input stream to return
through this stream.closeSourceStream
- True if the wrapped InputStream should be closed when this
InputSubstream is closed.public int read() throws java.io.IOException
read
in class SdkFilterInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class SdkFilterInputStream
java.io.IOException
public void mark(int readlimit)
mark
in class SdkFilterInputStream
public void reset() throws java.io.IOException
reset
in class SdkFilterInputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class SdkFilterInputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class SdkFilterInputStream
java.io.IOException
java.io.InputStream getWrappedInputStream()