Package java.io
Class StringReader
void mark(int readAheadLimit)
Overrides:
Throws:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
This method mark the present position in the stream. Subsequent calls to reset will reposition the stream to this point.
Example
String buffer = "Hello World";
StringReader sr = new StringReader(buffer);
int dim = 5;
char[] b = new char[dim];
sr.reset();
sr.read(b, 0, dim);
for (int i = 0; i < dim; i++)
Console.print("" + b[i]);
Console.println("");
if (sr.markSupported())
sr.mark(5);
sr.reset();
sr.read(b, 0, dim);
for (int i = 0; i < dim; i++)
Console.print("" + b[i]);
Console.println("");
sr.close();
A new position is assigned in the stream with the mark method.