Code example for CheckedInputStream

Methods: close, read

0
 
    public void test_read() throws Exception { 
        // testing that the return by skip is valid 
        InputStream checkInput = Support_Resources
                .getStream("hyts_checkInput.txt"); 
        CheckedInputStream checkIn = new CheckedInputStream(checkInput,
                new CRC32());
        checkIn.read();
        checkIn.close();
        try { 
            checkIn.read();
            fail("IOException expected.");
        } catch (IOException ee) {
            // expected 
        } 
        checkInput.close();
    } 
 
    public void test_read$byteII() throws Exception { 
        // testing that the return by skip is valid 
        InputStream checkInput = Support_Resources