Code example for CharArrayReader

Methods: close, mark, read, reset, skip

0
 
    /** 
     * java.io.CharArrayReader#reset() 
     */ 
    public void test_reset() throws IOException { 
        cr = new CharArrayReader(hw);
        cr.skip(5L);
        cr.mark(100);
        cr.read();
        cr.reset();
        assertEquals("Test 1: Reset failed to return to marker position.",
                'W', cr.read());
 
        cr.close();
        try { 
            cr.reset();
            fail("Test 2: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    }