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

      @InterfaceStability.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 and Description
    `LimitInputStream(InputStream in, long limit)`

  - ### Method Summary

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

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

- - ### Constructor Detail

    - #### LimitInputStream

          public LimitInputStream(InputStream in,
                                  long limit)

  - ### Method Detail

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

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