This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Calculation of total bits in a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Calculation of total bits in a file" Watch "Calculation of total bits in a file" New topic
Author

Calculation of total bits in a file

Gupta Nitin
Greenhorn

Joined: Feb 05, 2007
Posts: 7
Can anyone suggest an API method to calculate the checksum of an image? Why isn't there a method in File class to calculate total number of bits in a file?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

You might look at the java.util.zip.CRC32 class.

Why isn't this in "File"? Because java.io.File represents an abstract file path. It doesn't do anything with the contents of files.


[Jess in Action][AskingGoodQuestions]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Calculation of total bits in a file