File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes question regarding reading the binary file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "question regarding reading the binary file" Watch "question regarding reading the binary file" New topic
Author

question regarding reading the binary file

fei lin
Ranch Hand

Joined: Nov 25, 2007
Posts: 39
Can I hard code the starting point to read the start of data section? database(flatfile).? what is magic cookie value used for? Should I validate it evertime when user picked their file?

thanks
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Originally posted by fei lin:
Can I hard code the starting point to read the start of data section? database(flatfile).? what is magic cookie value used for? Should I validate it evertime when user picked their file?

thanks


Hi,

yes you can choose to hard code the starting point. I've read on the forum that many people did that. Simply mention it in your design choices.
The magic cookie is is meant to be used by your application to "garantee" that the database file is really the one your are expecting.
Imagine if the SUN examiner tries to use a different database with your application. You don't want that to happen, so you use the magic cookie to detect that..

Regards,
Alex
[ February 08, 2008: Message edited by: Alex Belisle Turcot ]
fei lin
Ranch Hand

Joined: Nov 25, 2007
Posts: 39
thanks so much, that clears out my confusion.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question regarding reading the binary file