com.amazonaws.services.s3.internal.crypto
Class AdjustedRangeInputStream
java.lang.Object
java.io.InputStream
com.amazonaws.services.s3.internal.crypto.AdjustedRangeInputStream
- All Implemented Interfaces:
- Closeable
public class AdjustedRangeInputStream
- extends InputStream
Reads only a specific range of bytes from the underlying input stream.
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.
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
read
public int read(byte[] buffer,
int offset,
int length)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.