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 and Description
    `BoundedRangeFileInputStream(FSDataInputStream in, long offset, long length)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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.lang.Object

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

- - ### Constructor Detail

    - #### 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 Detail

    - #### 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 `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `InputStream`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.