BufferedReader, BufferedWriter, PushbackReader classes, unread method in java.io

BufferedReader class: BufferedReader class in java.io is used to buffer input for increasing performance. Constructors defined by BufferedReader class:

BufferedReader(Reader istream)

BufferedReader(Reader istream, int bsize)

BufferedWriter class: BufferedWriter class in java.io is used to write data buffers to output stream. It is used to increase performance. Constructors defined by BufferedWriter class:

BufferedWriter(Writer ostream)

BufferedWriter(Writer ostream, int bsize)

PushbackReader class: It is used to return characters to input stream. Constructors defined by PushbackReader class:

PushbackReader(Reader istream)

PushbackReader(Reader istream, int bsize)

Method defined by PushbackReader class: unread

unread( ) method: It is used to push back the characters in input stream.


void unread(int ch)

By using buffer:

void unread(byte buffer[ ])

To push back nchars starting at offset:

void unread(byte buffer, int offset, int nchars)

Leave a Reply