Code example for FilterOutputStream

Methods: close, write

0
        } 
    } 
 
    public void test_close() throws IOException { 
        Support_OutputStream sos = new Support_OutputStream();
        os = new FilterOutputStream(sos);
        os.close();
 
        try { 
            os.write(42);
        } catch (java.io.IOException e) {
            fail("Test 1: Unexpected IOException.");
        } 
 
        sos.setThrowsException(true);
        try { 
            os.write(42);
            fail("Test 2: IOException expected.");
        } catch (java.io.IOException e) {
            // Expected. 
        }