public static String getCRC32Checksum ( InputStream is ) throws IOException { Checksum checksum = new CRC32 ( ) ; byte [ ] bytes = new byte [ 1024 ] ; int len = 0 ; while ( ( len = is . read ( bytes ) ) >= 0 ) { checksum . update ( bytes , 0 , len ) ; } return Long . toString ( checksum . getValue ( ) ) ; }
Returns the CRC 32 Checksum of the input stream