Java CharArrayReader Class

The CharArrayReader is composed of two words: CharArray and Reader. The CharArrayReader class is used to read character array as a reader (stream). It inherits Reader class.

Java CharArrayReader class declaration

public class CharArrayReader extends Reader

Java CharArrayReader class methods

  1. int read()

    It is used to read a single character

  2. int read(char[] b, int off, int len)

    It is used to read characters into the portion of an array.

  3. boolean ready()

    It is used to tell whether the stream is ready to read.

  4. boolean markSupported()

    It is used to tell whether the stream supports mark() operation.

  5. long skip(long n)

    It is used to skip the character in the input stream.

  6. void mark(int readAheadLimit)

    It is used to mark the present position in the stream.

  7. void reset()

    It is used to reset the stream to a most recent mark.

  8. void close()

    It is used to closes the stream.

Example of CharArrayReader Class:

Flash Soon



Copyright ©2017 Design& develop