Compressing Streams: File Summer
import java.io.FileInputStream; import java.io.IOException; import java.util.zip.CRC32; import java.util.zip.Checksum; public class Main { public static void main(String[] args) throws IOException { FileInputStream fin = new FileInputStream("a.zip"); Checksum cs = new CRC32(); for (int b = fin.read(); b != -1; b = fin.read()) { cs.update(b); } System.out.println(cs.getValue()); fin.close(); } }