i2p.susi.util

## Class CountingInputStream

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

- All Implemented Interfaces:
    ReadCounter, Closeable, AutoCloseable
  Direct Known Subclasses:
    LimitInputStream

      public class CountingInputStream
      extends FilterInputStream
      implements ReadCounter

  InputStream that counts bytes read and skipped.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `count`

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

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CountingInputStream(InputStream in)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getRead()` The total number of bytes that have been read or skipped
    `int` | `read()`
    `int` | `read(byte[] buf, int off, int len)`
    `long` | `skip(long n)`

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

      `available, close, mark, markSupported, read, reset`

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

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

- - ### Field Detail

    - #### count

          protected long count

  - ### Constructor Detail

    - #### CountingInputStream

          public CountingInputStream(InputStream in)

  - ### Method Detail

    - #### getRead

          public long getRead()

      Description copied from interface: `ReadCounter`
      The total number of bytes that have been read or skipped
      Specified by:
        `getRead` in interface `ReadCounter`

    - #### read

          public int read()
                   throws IOException

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

    - #### read

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

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

    - #### skip

          public long skip(long n)
                    throws IOException

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