code: private static long getCRC(InputStream is) throws IOException {
          CheckedInputStream check = new CheckedInputStream(is, new CRC32());
          BufferedInputStream in = new BufferedInputStream(check);
          while (in.read() != -1) {
              // Read file in completely
          }
          long crc = check.getChecksum().getValue();
          return crc;
      }
docs: Get the CRC of a file from an InputStream
  
  @param is The input stream to obtain the CRC from
  @return a long representing the CRC value of the data read from the supplied input stream
  @throws IOException