Package org.apache.commons.io.input
Class UnsynchronizedReader
- java.lang.Object
-
- java.io.Reader
-
- org.apache.commons.io.input.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
AReader
without any of the superclass' synchronization.- Since:
- 2.17.0
-
-
Constructor Summary
Constructors Constructor Description UnsynchronizedReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isClosed()
Tests whether this instance is closed; ifclose()
completed successfully.void
setClosed(boolean closed)
Sets whether this instance is closed.long
skip(long n)
Skips characters by reading from this instance.
-
-
-
Constructor Detail
-
UnsynchronizedReader
public UnsynchronizedReader()
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Reader
- Throws:
java.io.IOException
-
isClosed
public boolean isClosed()
Tests whether this instance is closed; ifclose()
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 classjava.io.Reader
- Parameters:
n
- The number of characters to skip.- Returns:
- The number of characters actually skipped.
- Throws:
java.lang.IllegalArgumentException
- Ifn
is negative.java.io.IOException
- If an I/O error occurs.
-
-