Java IO Tutorial - Java CharArrayReader(char[] buf, int offset, int length) Constructor








Syntax

CharArrayReader(char[] buf, int offset, int length) constructor from CharArrayReader has the following syntax.

public CharArrayReader(char[] buf,    int offset,    int length)

Example

In the following code shows how to use CharArrayReader.CharArrayReader(char[] buf, int offset, int length) constructor.

/*  w w  w .  ja v  a 2s .c om*/
import java.io.CharArrayReader;

public class Main {
  public static void main(String[] args) throws Exception {

    char[] ch = { 'A', 'B', 'C', 'D', 'E' ,'F', 'G', 'H', 'I', 'J',};

    CharArrayReader car = new CharArrayReader(ch,2,3);

  }
}