Code example for FilterOutputStream

Methods: write

0
        } 
    } 
 
    public void test_write$BII_Exception() throws IOException { 
        Support_OutputStream sos = new Support_OutputStream(testLength);
        os = new FilterOutputStream(sos);
        byte[] buf = new byte[10];
 
        try { 
            os.write(buf, -1, 1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            os.write(buf, 0, -1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            os.write(buf, 10, 1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
    }