org.apache.commons.io.input

## Class AbstractInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.commons.io.input.AbstractInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Direct Known Subclasses:
    CircularInputStream, MemoryMappedFileInputStream, NullInputStream, RandomAccessFileInputStream, ReaderInputStream

      public abstract class AbstractInputStream
      extends InputStream

  Abstracts some InputStream operations for implementations in this package.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractInputStream()` Constructs a new instance for subclasses.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `checkOpen()` Checks if this instance is closed and throws an IOException if so.
    `void` | `close()`
    `boolean` | `isClosed()` Tests whether this instance is closed; if `close()` completed successfully.
    `void` | `setClosed(boolean closed)` Sets whether this instance is closed.

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

      `available, mark, markSupported, read, read, read, reset, skip`

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

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

- - ### Constructor Detail

    - #### AbstractInputStream

          public AbstractInputStream()

      Constructs a new instance for subclasses.

  - ### Method Detail

    - #### checkOpen

          void checkOpen()
                  throws IOException

      Checks if this instance is closed and throws an IOException if so.
      Throws:
        `IOException` - if this instance is closed.

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `InputStream`
      Throws:
        `IOException`

    - #### isClosed

          public boolean isClosed()

      Tests whether this instance is closed; if `close()` completed successfully.
      Returns:
        whether this instance is closed.

    - #### setClosed

          public void setClosed(boolean closed)

      Sets whether this instance is closed.
      Parameters:
        `closed` - whether this instance is closed.