public static long digestStream(InputStream in) throws IOException {
    CRC32 crc = new CRC32();
    byte[] BUFFER = new byte[8192];
    int size;
    while ((size = in.read(BUFFER)) != -1) {
      crc.update(BUFFER, 0, size);
    }
    return crc.getValue();
  }
public static long digestStream(InputStream in)