Code example for CharArrayReader

Methods: close, read

0
     */ 
    public void test_read() throws IOException { 
        cr = new CharArrayReader(hw);
        assertEquals("Test 1: Read returned incorrect char;",
                'H', cr.read());
        cr = new CharArrayReader(new char[] { '\u8765' });
        assertTrue("Test 2: Incorrect double byte char;",
                cr.read() == '\u8765');
 
        cr.close();
        try { 
            cr.read();
            fail("Test 3: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    } 
 
    /** 
     * java.io.CharArrayReader#read(char[], int, int) 
     */