wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 24183
    
  34

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]
 
 
subject: CheckSum
 
Similar Threads
Checksum for Image comparison
Use of Checksum command
HashCode
Reload a File when changes happen in that file
Am I just stupid?