Methods defined by Reader class in

Reader class is an abstract class in used for handling character stream input.

Methods defined by Reader class:

read method: To read characters read( ) method is used. Read method is used to read a character from an input stream. It returns an integer value; it returns -1 for end of stream.


int read( )

To read a buffer:


int read(char buffer[ ])

To read a buffer to nchars:


int read(char buffer[ ], int offset, int nchars)

close method: It is used to close an input stream.


abstract void close( )

mark( ) method: It is used to place a mark at a current point in input stream. This mark remains until nchars are read.


void mark(int nchars)

markSupported( ) method: It returns true if methods mark( ) and reset( ) are supported by calling stream.


boolean markSupported( )

reset( ) method: It is used to reset input pointer to a mark which was set before.


void reset( )

ready( ) method: It returns true if next input request is ready, otherwise false.


boolean ready( )

skip( ) method: It is used to skip nchars of input.


long skip(long nchars)

Leave a Reply