LimitInputStream (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, class: LimitInputStream

Package org.apache.hadoop.util

# Class LimitInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.hadoop.util.LimitInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

@Unstable public final class LimitInputStream extends FilterInputStream
Copied from guava source code v15 (LimitedInputStream) Guava deprecated LimitInputStream in v14 and removed it in v15. Copying this class here allows to be compatible with guava 11 to 15+. Originally: org.apache.hadoop.hbase.io.LimitInputStream

- ## Field Summary

  ### Fields inherited from class java.io.FilterInputStream

  `in`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LimitInputStream(InputStream in, long limit)`

- ## Method Summary

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

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

  `close, markSupported, read`

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

  - ### LimitInputStream

    public LimitInputStream(InputStream in, long limit)

- ## Method Details

  - ### available

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

  - ### mark

    public void mark(int readLimit)
    Overrides:
      `mark` in class `FilterInputStream`

  - ### read

    public int read() throws IOException
    Overrides:
      `read` in class `FilterInputStream`
    Throws:
      `IOException`

  - ### read

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

  - ### reset

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

  - ### skip

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