List of usage examples for java.io PushbackReader read
public int read(java.nio.CharBuffer target) throws IOException
From source file:Main.java
public static void main(String[] args) { String s = "from java2s.com"; StringReader sr = new StringReader(s); PushbackReader pr = new PushbackReader(sr, 20); char cbuf[] = new char[5]; try {// www . jav a 2 s . com System.out.println(pr.read(cbuf)); System.out.println(cbuf); pr.close(); } catch (IOException ex) { ex.printStackTrace(); } }