Class AdjustedRangeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.amazonaws.internal.SdkInputStream
-
- com.amazonaws.services.s3.internal.crypto.AdjustedRangeInputStream
-
- All Implemented Interfaces:
com.amazonaws.internal.MetricAware
,com.amazonaws.internal.Releasable
,Closeable
,AutoCloseable
public class AdjustedRangeInputStream extends com.amazonaws.internal.SdkInputStream
Reads only a specific range of bytes from the underlying input stream.
-
-
Constructor Summary
Constructors Constructor Description AdjustedRangeInputStream(InputStream objectContents, long rangeBeginning, long rangeEnd)
Creates a new DecryptedContentsInputStream object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
protected InputStream
getWrappedInputStream()
Returns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.int
read()
int
read(byte[] buffer, int offset, int length)
-
Methods inherited from class com.amazonaws.internal.SdkInputStream
abort, abortIfNeeded, isMetricActivated, release
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
AdjustedRangeInputStream
public AdjustedRangeInputStream(InputStream objectContents, long rangeBeginning, long rangeEnd) throws IOException
Creates a new DecryptedContentsInputStream object.- Parameters:
objectContents
- The input stream containing the object contents retrieved from S3rangeBeginning
- The position of the left-most byte desired by the userrangeEnd
- The position of the right-most byte desired by the user- Throws:
IOException
- If there are errors skipping to the left-most byte desired by the user.
-
-
Method Detail
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int length) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getWrappedInputStream
protected InputStream getWrappedInputStream()
Description copied from class:com.amazonaws.internal.SdkInputStream
Returns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.- Specified by:
getWrappedInputStream
in classcom.amazonaws.internal.SdkInputStream
-
-