Package 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.

Since:
  2.17.0

- ## Field Summary

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

  `lock`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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 Details

  - ### UnsynchronizedReader

    public UnsynchronizedReader()
    Constructs a new instance.

- ## Method Details

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    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.