Code example for CharArrayReader

Methods: read, skip

0
 
    /** 
     * @tests java.io.CharArrayReader#skip(long) 
     */ 
    public void test_skipJ() throws IOException { 
        cr = new CharArrayReader(hw);
        long skipped = cr.skip(5L);
 
        assertEquals("Failed to skip correct number of chars", 5L, skipped);
        assertEquals("Skip skipped wrong chars", 'W', cr.read());
    } 
 
    /** 
     * Tears down the fixture, for example, close a network connection. This 
     * method is called after a test is executed. 
     */ 
    protected void tearDown() { 
        if (cr != null)
            cr.close();
    } 
}