i2p.susi.util

## Class LimitInputStream

- java.lang.Object
- - java.io.InputStream
  - - java.io.FilterInputStream
    - - i2p.susi.util.CountingInputStream
      - - i2p.susi.util.LimitInputStream

- All Implemented Interfaces:
    ReadCounter, Closeable, AutoCloseable

      public class LimitInputStream
      extends CountingInputStream

  InputStream that limits total bytes read to a specified maximum.

- - ### Field Summary

    - ### Fields inherited from class i2p.susi.util.CountingInputStream

      `count`

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

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LimitInputStream(InputStream in, long max)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `int` | `read()`
    `int` | `read(byte[] buf, int off, int len)`
    `long` | `skip(long n)`

    - ### Methods inherited from class i2p.susi.util.CountingInputStream

      `getRead`

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

      `close, mark, markSupported, read, reset`

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

      Parameters:
        `max` - max number of bytes to read

  - ### Method Detail

    - #### available

          public int available()
                        throws IOException

      Overrides:
        `available` in class `FilterInputStream`
      Throws:
        `IOException`

    - #### read

          public int read()
                   throws IOException

      Overrides:
        `read` in class `CountingInputStream`
      Throws:
        `IOException`

    - #### read

          public int read(byte[] buf,
                          int off,
                          int len)
                   throws IOException

      Overrides:
        `read` in class `CountingInputStream`
      Throws:
        `IOException`

    - #### skip

          public long skip(long n)
                    throws IOException

      Overrides:
        `skip` in class `CountingInputStream`
      Throws:
        `IOException`