Class S3ARemoteObjectReader

java.lang.Object
org.apache.hadoop.fs.s3a.prefetch.S3ARemoteObjectReader
All Implemented Interfaces:
Closeable, AutoCloseable

public class S3ARemoteObjectReader extends Object implements Closeable
Provides functionality to read S3 file one block at a time.
  • Constructor Details

  • Method Details

    • read

      public int read(ByteBuffer buffer, long offset, int size) throws IOException
      Stars reading at offset and reads upto size bytes into buffer.
      Parameters:
      buffer - the buffer into which data is returned
      offset - the absolute offset into the underlying file where reading starts.
      size - the number of bytes to be read.
      Returns:
      number of bytes actually read.
      Throws:
      IOException - if there is an error reading from the file.
      IllegalArgumentException - if buffer is null.
      IllegalArgumentException - if offset is outside of the range [0, file size].
      IllegalArgumentException - if size is zero or negative.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable