It is an abstract class which is used for reading character streams. read(char[], int, int) and close() are the only methods which a subclass must implement. Many subclasses will override some of the methods to provide higher efficiency, additional functionality, or both. CharArrayReader, FilterReader, BufferedReader , InputStreamReader, PipedReader, StringReader are few of the examples in Reader class implementation.
The following is the syntax of class declaration
public class Reader extends Object implements DataOutput, DataInput, Closeable
The Field for java.io.Reader class are
protected Object lock- the stream synchronization is carried out by this object
Sl No | Constructor | Description |
1 |
protectedReader() |
Critical sections will get synchronized on itself of the created new character-stream |
2 |
protectedReader(Object Lock) |
Critical sections get synchronized on the given object in the new character – stream created |
Sl No | Method Name |
1 |
abstract void close() |
2 |
void mark(int readAheadLimit) |
3 |
int read() |
4 |
boolean markSupported() |
5 |
int read(char[] cbuf) |
6 |
int read(CharBuffer target) |
7 |
abstract int read(char[] cbuf, int off, int len) |
8 |
void reset() |
Welcome to Knowledge2life.
|