List of usage examples for java.nio CharBuffer read
public int read(CharBuffer target) throws IOException
From source file:Main.java
public static void main(String[] args) throws IOException { CharBuffer cb1 = CharBuffer.allocate(20); cb1.append("java2s.com"); cb1.rewind();// w w w.j av a2s .c o m System.out.println(Arrays.toString(cb1.array())); CharBuffer cb2 = CharBuffer.allocate(50); cb2.read(cb1); System.out.println(cb2); }