Code example for CheckedInputStream

Methods: getChecksum

0
	 * @tests java.util.zip.CheckedInputStream#CheckedInputStream(java.io.InputStream, 
	 *        java.util.zip.Checksum) 
	 */ 
	public void test_ConstructorLjava_io_InputStreamLjava_util_zip_Checksum() throws Exception { 
        InputStream checkInput = Support_Resources.getStream("hyts_checkInput.txt");
        CheckedInputStream checkIn = new CheckedInputStream(checkInput, new CRC32());
        assertEquals("constructor of checkedInputStream has failed", 0, checkIn.getChecksum()
                .getValue());
        checkInput.close();
    } 
 
	/** 
	 * @tests java.util.zip.CheckedInputStream#getChecksum() 
	 */ 
	public void test_getChecksum() throws Exception { 
        byte outBuf[] = new byte[100];
        // testing getChecksum for an empty file 
        FileOutputStream outEmp = new FileOutputStream("empty.txt");
        outEmp.close();
        InputStream inEmp = new FileInputStream("empty.txt");
        CheckedInputStream checkEmpty = new CheckedInputStream(inEmp, new CRC32());