StringReader class methods in Java

java.io.StringReader

A character stream whose source is a string.

StringReader extends Reader

Implemented Interfaces:

Closeable

AutoCloseable

Readable

Some methods of StringReader class

close()This method closes the stream and releases any system resources associated with it.

mark(int)This method marks the present position in the stream. Subsequent calls to reset() will reposition the stream to this point.

markSupported()This method tells whether this stream supports the mark() operation, which it does.

read()This method reads a single character.

read(char[], int, int)This method reads characters into a portion of an array.

ready()This method tells whether this stream is ready to be read.

reset()This method resets the stream to the most recent mark, or to the beginning of the string if it has never been marked.

skip(long)This method skips the specified number of characters in the stream.

StringReader(String)This method creates a new string reader.

No comments:

Post a Comment