Code example for CharArrayWriter

Methods: write

0
        } 
    } 
 
    public void test_write$CII_Exception() { 
        char[] target = new char[10];
        cw = new CharArrayWriter();
        try { 
            cw.write(target, -1, 1);
            fail("Test 1: IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
        try { 
            cw.write(target, 0, -1);
            fail("Test 2: IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
        try { 
            cw.write(target, 1, target.length);
            fail("Test 3: IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
        try { 
            cw.write((char[]) null, 1, 1);
            fail("Test 4: NullPointerException expected.");
        } catch (NullPointerException e) {
            // Expected. 
        } 
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE