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
ConstructorsConstructorDescriptionAdjustedRangeInputStream
(InputStream objectContents, long rangeBeginning, long rangeEnd) Creates a new DecryptedContentsInputStream object. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
protected InputStream
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, skipNBytes, transferTo
-
Constructor Details
-
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 Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
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
-