Code example for CharBuffer

Methods: append

0
	public int read(CharBuffer cb) throws IOException {
		if (count-- == 0) {
			return -1; 
		} 
 
		cb.append(next());
 
		return 10; 
	} 
 
} 
 
public class Exercise16 { 
 
	/** 
	 * @param args 
	 */ 
	public static void main(String[] args) {
		Scanner s = new Scanner(new PrototypeAdapter(50));
		while (s.hasNext()) {
			print(s.next());