Here you can find the source of crc32(File f)
public static long crc32(File f) throws Throwable
//package com.java2s; //License from project: Open Source License import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.util.zip.CRC32; import java.util.zip.CheckedInputStream; public class Main { public static long crc32(File f) throws Throwable { CheckedInputStream cis = new CheckedInputStream(new BufferedInputStream(new FileInputStream(f)), new CRC32()); try {//from w w w .java2 s. c o m while (cis.read() != -1) { } return cis.getChecksum().getValue(); } finally { cis.close(); } } }