Code example for CharBuffer

Methods: append

0
            super(param);
        } 
 
        public int read(CharBuffer target) throws IOException {
            if (timesRead == 1) {
                target.append('1');
                target.append('2');
                target.append('3');
                timesRead++;
                return 3; 
            } else if (timesRead == 2) {
                target.append('t');
                timesRead++;
                return 1; 
            } else { 
                throw new IOException();
            } 
        } 
 
    }