Java StringReader Class
In StringReader class, system resources like network sockets and files are not used, therefore closing the StringReader is not necessary.
Java StringReader class declaration
Let’s see the declaration for Java.io.StringReader class:
Methods of StringReader class
|It is used to read a single character.
|int read(char cbuf, int off, int len)
|It is used to read a character into a portion of an array.
|It is used to tell whether the stream is ready to be read.
|It is used to tell whether the stream support mark() operation.
|long skip(long ns)
|It is used to skip the specified number of character in a stream
|void mark(int readAheadLimit)
|It is used to mark the mark the present position in a stream.
|It is used to reset the stream.
|It is used to close the stream.
Java StringReader Example
Hello Java!! Welcome to Tutor Aspire.