org.apache.commons.io.input

## Class UnsynchronizedReader

- java.lang.Object
- - java.io.Reader
  - - org.apache.commons.io.input.UnsynchronizedReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Readable
  Direct Known Subclasses:
    UnsynchronizedBufferedReader

      public abstract class UnsynchronizedReader
      extends Reader

  A `Reader` without any of the superclass' synchronization.

- - ### Field Summary

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

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnsynchronizedReader()` Constructs a new instance.

  - ### 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.
    `long` | `skip(long n)` Skips characters by reading from this instance.

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

      `mark, markSupported, read, read, read, read, ready, reset`

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

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

- - ### Constructor Detail

    - #### UnsynchronizedReader

          public UnsynchronizedReader()

      Constructs a new instance.

  - ### 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`
      Specified by:
        `close` in class `Reader`
      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.

    - #### skip

          public long skip(long n)
                    throws IOException

      Skips characters by reading from this instance. This method will block until:
      - some characters are available,
      - an I/O error occurs, or
      - the end of the stream is reached.
      Overrides:
        `skip` in class `Reader`
      Parameters:
        `n` - The number of characters to skip.
      Returns:
        The number of characters actually skipped.
      Throws:
        `IllegalArgumentException` - If `n` is negative.
        `IOException` - If an I/O error occurs.