Here you can find the source of crc32(final InputStream input)
public static long crc32(final InputStream input) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.zip.CRC32; public class Main { private static final int EOF = -1; public static long crc32(final InputStream input) throws IOException { byte[] buffer = new byte[4096]; CRC32 crc = new CRC32(); crc.reset();/*from w ww .ja va 2 s . c o m*/ int n = 0; while (EOF != (n = input.read(buffer))) { crc.update(buffer, 0, n); } return crc.getValue(); } }