Java StringReader create from String
import java.io.StringReader; public class Main { public static void main(String[] args) throws Exception { StringReader in1 = new StringReader("demo from demo2s.com"); int c;// w w w . j av a 2 s. c o m while ((c = in1.read()) != -1) System.out.print((char) c); } }