Create StringReader from a string : StringReader « File « Java Tutorial






import java.io.IOException;
import java.io.StringReader;

public class MainClass {
  public static void main(String[] args) throws IOException {


    StringReader in2 = new StringReader("a bc ddd");
    int c;
    while ((c = in2.read()) != -1)
      System.out.print((char) c);

  }
}//
a bc ddd








11.35.StringReader
11.35.1.Using the StringReader class
11.35.2.Create StringReader from a string
11.35.3.Create BufferedReader from StringReader