Calculating the Checksum of a File

try { // Compute Adler-32 checksum CheckedInputStream cis = new CheckedInputStream( new FileInputStream("filename"), new Adler32()); byte[] tempBuf = new byte[128]; while (cis.read(tempBuf) >= 0) { } long checksum = cis.getChecksum().getValue(); } catch (IOException e) { }

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.