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 AutoCloseable
IOException
public void mark(int readAheadLimit) throws IOException
IOException
public boolean markSupported()
public int read() throws IOException
IOException
public int read(char[] cbuf) throws IOException
IOException
public abstract int read(char[] cbuf, int off, int len) throws IOException
IOException
public boolean ready() throws IOException
IOException
public void reset() throws IOException
IOException
public long skip(long n) throws IOException
IOException