Code example for CRC32

0
    /** The CRC32 being calculated by this input stream */ 
    private CRC32 crc32;
 
    public CRC32ChecksumCalculatingInputStream(InputStream in) {
        super(in);
        crc32 = new CRC32();
    } 
 
    public long getCRC32Checksum() { 
        return crc32.getValue();
    } 
 
    /** 
     * Resets the wrapped input stream and the CRC32 computation. 
     * 
     * @see java.io.InputStream#reset() 
     */ 
    @Override 
    public synchronized void reset() throws IOException { 
        crc32.reset();
        in.reset();