This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes CheckSum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "CheckSum" Watch "CheckSum" New topic
Author

CheckSum

Sandya Bhaskara
Ranch Hand

Joined: Aug 20, 2004
Posts: 73
what is checksum?how java uses it for file compression??read some notes related to checksum but its confusing...can any1 explain it in detail?


Sandy<br />SCJP1.4 SCWCD1.4<br />SCBCD(preparing)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

A "checksum" is a function that you compute using all the bytes of a file, message, or other chunk of data. If you compute the checksum before transmitting (or saving, or compressing) some data, then compute it again after the transmission (or after loading, or decompressing) then the two values should match. If they do, you can be pretty sure the transmission happened with no errors. If they don't match, you know the received data is corrupt.

One very common checksum algorithm is called CRC, "cyclic redundancy check." There's a java.util.zip.CRC32 class that implements this algorithm, and the GZIP stream classes use it to check the validity of data they process.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CheckSum
 
Similar Threads
Am I just stupid?
HashCode
Reload a File when changes happen in that file
Use of Checksum command
Checksum for Image comparison