Code example for FilterOutputStream

Methods: write

0
        } 
    } 
 
    public void test_writeI() throws IOException { 
        Support_OutputStream sos = new Support_OutputStream(1);
        os = new FilterOutputStream(sos);
        os.write(42);
 
        bis = new ByteArrayInputStream(sos.toByteArray());
        assertTrue("Test 1: Byte has not been written.",
                bis.available() == 1);
        assertEquals("Test 2: Incorrect byte written or read;",
                42, bis.read());
 
        try { 
            // Support_OutputStream throws an IOException if the internal 
            // buffer is full, which it should be now. 
            os.write(42);
            fail("Test 2: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    } 
Connect your IDE to all the code out there  Get Codota for Java