Package java.io
Class StringReader
int read()
Overrides:
Throws:
int read(char[] b, int off, int len)
Overrides:
Throws:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
read() method:
The read method reads a single character.
read(byte[] buf, int off, int len) method:
This method reads characters into a portion of an array.
Example
String buffer = "Hello World";
StringReader sr = new StringReader(buffer);
int dim = 6;
char[] b = new char[dim];
sr.read(b, 0, dim);
for (int i = 0; i < dim; i++)
Console.print("" + b[i]);
Console.println("");
sr.close();
The example above reads six characters from the stream and prints it to the console.