Code example for CharBuffer

Methods: append

0
        public MockStringReader(String param) {
            super(param);
        } 
 
        public int read(CharBuffer target) throws IOException {
            target.append('t');
            target.append('e');
            target.append('s');
            target.append('t');
            throw new IOException();
        } 
 
    } 
     
    private static class MockStringReader2Read extends StringReader {
        private int timesRead = 1;
 
        public MockStringReader2Read(String param) {
            super(param);
        }