public abstract class Reader extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected Object |
lock
The object used to synchronize operations on this stream.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Reader()
Create a new character-stream reader whose critical sections will synchronize on the reader itself.
|
protected |
Reader(Object lock)
Create a new character-stream reader whose critical sections will synchronize on the given object.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Close the stream.
|
void |
mark(int readAheadLimit)
Mark the present position in the stream.
|
boolean |
markSupported()
Tell whether this stream supports the mark() operation.
|
int |
read()
Read a single character.
|
int |
read(char[] cbuf)
Read characters into an array.
|
abstract int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array.
|
boolean |
ready()
Tell whether this stream is ready to be read.
|
void |
reset()
Reset the stream.
|
long |
skip(long n)
Skip characters.
|
protected Object lock
protected Reader()
protected Reader(Object lock)
public abstract void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic void mark(int readAheadLimit)
throws IOException
IOExceptionpublic boolean markSupported()
public int read()
throws IOException
IOExceptionpublic int read(char[] cbuf)
throws IOException
IOExceptionpublic abstract int read(char[] cbuf,
int off,
int len)
throws IOException
IOExceptionpublic boolean ready()
throws IOException
IOExceptionpublic void reset()
throws IOException
IOExceptionpublic long skip(long n)
throws IOException
IOException