Class UnsynchronizedReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable
    Direct Known Subclasses:
    UnsynchronizedBufferedReader

    public abstract class UnsynchronizedReader
    extends java.io.Reader
    A Reader without any of the superclass' synchronization.
    Since:
    2.17.0
    • Field Summary

      • Fields inherited from class java.io.Reader

        lock
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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, nullReader, read, read, read, read, ready, reset, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Reader
        Throws:
        java.io.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 java.io.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 java.io.Reader
        Parameters:
        n - The number of characters to skip.
        Returns:
        The number of characters actually skipped.
        Throws:
        java.lang.IllegalArgumentException - If n is negative.
        java.io.IOException - If an I/O error occurs.