com.amazonaws.services.s3.internal.crypto
Class AdjustedRangeInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by 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.


Constructor Summary
AdjustedRangeInputStream(InputStream objectContents, long rangeBeginning, long rangeEnd)
          Creates a new DecryptedContentsInputStream object.
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 int read(byte[] buffer, int offset, int length)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 S3
rangeBeginning - The position of the left-most byte desired by the user
rangeEnd - 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 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.