
CharArrayReader Class in Java
CharArrayReader class is a character input stream that uses a character array as the source of the characters it returns. we create a CharArrayReader by specifying the character array, or portion of an array, that it is to read from.
The character array we pass to the CharArrayReader is not copied by this class. This means that changes we make to the elements of the array after we create the input stream do affect the values read from the array.
CharArrayReader defines the normal Reader methods, and supports the mark () and reset () methods.
The class CharArrayReader is defined as
public class java.io.CharArrayReader extends java.io.Reader{
// Public Constructors
public CharArrayReader (char [ ] buf);
public CharArrayReader (char [ ] buf, int offset, int length);
// Protected Instance Variables
protected charl ] buf:
protected int count;
protected int markedPos;
protected int pos;
// Public Instance Methods
public void close ();// Defines Reader
public void mark (int readAheadLimit) throws IOException;// Overrides Reader
public boolean markSupported ();// Overrides Reader
public int read () throws IOException;// Overrides Reader
public int read (char [ ] b, int off, int len) throws IOException;//Defines Reader
public boolean ready () throws IOException;// Overrides Reader
public void reset () throws IOException;// Overrides Reader
public long skip (long n) throws IOException;// Overrides Reader
}