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
AReaderwithout any of the superclass' synchronization.- Since:
- 2.17.0
-
-
Constructor Summary
Constructors Constructor Description UnsynchronizedReader()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisClosed()Tests whether this instance is closed; ifclose()completed successfully.voidsetClosed(boolean closed)Sets whether this instance is closed.longskip(long n)Skips characters by reading from this instance.
-
-
-
Constructor Detail
-
UnsynchronizedReader
public UnsynchronizedReader()
Constructs a new instance.
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein 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:
skipin classjava.io.Reader- Parameters:
n- The number of characters to skip.- Returns:
- The number of characters actually skipped.
- Throws:
java.lang.IllegalArgumentException- Ifnis negative.java.io.IOException- If an I/O error occurs.
-
-