Code example for FilterOutputStream

Methods: write

0
 
    public void test_ConstructorLjava_io_OutputStream() { 
        // Test for method java.io.FilterOutputStream(java.io.OutputStream) 
        try { 
            bos = new ByteArrayOutputStream();
            os = new FilterOutputStream(bos);
            os.write('t');
        } catch (java.io.IOException e) {
            fail("Constructor test failed : " + e.getMessage());
        } 
    } 
 
    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.");