Class S3AInMemoryInputStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.fs.s3a.prefetch.S3ARemoteInputStream
org.apache.hadoop.fs.s3a.prefetch.S3AInMemoryInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.fs.CanSetReadahead, org.apache.hadoop.fs.statistics.IOStatisticsSource, org.apache.hadoop.fs.StreamCapabilities

public class S3AInMemoryInputStream extends S3ARemoteInputStream
Provides an InputStream that allows reading from an S3 file. The entire file is read into memory before reads can begin. Use of this class is recommended only for small files that can fit entirely in memory.
  • Constructor Details

  • Method Details

    • ensureCurrentBuffer

      protected boolean ensureCurrentBuffer() throws IOException
      Ensures that a non-empty valid buffer is available for immediate reading. It returns true when at least one such buffer is available for reading. It returns false on reaching the end of the stream.
      Specified by:
      ensureCurrentBuffer in class S3ARemoteInputStream
      Returns:
      true if at least one such buffer is available for reading, false otherwise.
      Throws:
      IOException - if there is an IO error during this operation.