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.SdkInputStreamReads 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 intavailable()voidclose()protected InputStreamgetWrappedInputStream()Returns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.intread()intread(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:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] buffer, int offset, int length) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
getWrappedInputStream
protected InputStream getWrappedInputStream()
Description copied from class:com.amazonaws.internal.SdkInputStreamReturns the underlying input stream, if any, from the subclass; or null if there is no underlying input stream.- Specified by:
getWrappedInputStreamin classcom.amazonaws.internal.SdkInputStream
-
-