Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparing two Files

 
martin chile
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to compare two Files, one of them might be different(just a changed character or a whole paragraph more).
Comparing the length or the last modified date is not working when there are small differences.
Is there a fast way to read the checksum or something like that, so that i don't have to open the documents to look by my own.
Thanks for helping me!
Martin
 
Joe Ess
Bartender
Posts: 9279
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the files in using different instances of java.util.zip.CheckedInputStream, then compare their checksums.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic