BoundedRangeFileInputStream (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.file.tfile, class: BoundedRangeFileInputStream

Package org.apache.hadoop.io.file.tfile

# Class BoundedRangeFileInputStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.io.file.tfile.BoundedRangeFileInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class BoundedRangeFileInputStream extends InputStream
BoundedRangeFIleInputStream abstracts a contiguous region of a Hadoop FSDataInputStream as a regular input stream. One can create multiple BoundedRangeFileInputStream on top of the same FSDataInputStream and they would not interfere with each other.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BoundedRangeFileInputStream(FSDataInputStream in, long offset, long length)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `available()`
  `void`
  `close()`
  `void`
  `mark(int readlimit)`
  `boolean`
  `markSupported()`
  `int`
  `read()`
  `int`
  `read(byte[] b)`
  `int`
  `read(byte[] b, int off, int len)`
  `void`
  `reset()`
  `long`
  `skip(long n)`

  ### Methods inherited from class java.io.InputStream

  `nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BoundedRangeFileInputStream

    public BoundedRangeFileInputStream(FSDataInputStream in, long offset, long length)
    Constructor
    Parameters:
      `in` - The FSDataInputStream we connect to.
      `offset` - Beginning offset of the region.
      `length` - Length of the region. The actual length of the region may be smaller if (off_begin + length) goes beyond the end of FS input stream.

- ## Method Details

  - ### available

    public int available() throws IOException
    Overrides:
      `available` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read() throws IOException
    Specified by:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] b) throws IOException
    Overrides:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] b, int off, int len) throws IOException
    Overrides:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### skip

    public long skip(long n) throws IOException
    Overrides:
      `skip` in class `InputStream`
    Throws:
      `IOException`

  - ### mark

    public void mark(int readlimit)
    Overrides:
      `mark` in class `InputStream`

  - ### reset

    public void reset() throws IOException
    Overrides:
      `reset` in class `InputStream`
    Throws:
      `IOException`

  - ### markSupported

    public boolean markSupported()
    Overrides:
      `markSupported` in class `InputStream`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `InputStream`