aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes (Urlybird1.3.1) Magic cookie is Header Length 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 "(Urlybird1.3.1) Magic cookie is Header Length" Watch "(Urlybird1.3.1) Magic cookie is Header Length" New topic
Author

(Urlybird1.3.1) Magic cookie is Header Length

Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Sorry if this has been posted before but it seems to be a source of much discussion.
Anyone noticed this before, its not just some random integer that denotes a data file:

Total Header Length: 257 = Magic Cookie:257


O


[ September 27, 2006: Message edited by: Mark Smyth ]
[ September 27, 2006: Message edited by: Barry Gaunt ]

SCJP<br />SCJD
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
I do not agree. In my URLyBird assignment the header size is 56 bytes and the magic cookie is 259. In fact I do not see why your header size is so big as 257 bytes.
[ September 27, 2006: Message edited by: Edwin Dalorzo ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please do not publish detailed information about the assignment database schema - it spoils the fun for other SCJD candidates.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11525
    
100

Several people have noticed that the magic cookie appears to be related to the version number of their assignment.

So Mark has a cookie of 257 = 0x101 = version 1.x.1 of the assignment (and from your subject, you state that you are working on 1.3.1 of the assignment).

Edwin has a cookie of 259 = 0x103 = version 1.x.3 of the assignment. Edwin - care to confirm?

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
Very interesting, Adrew.

You seem to be completely right. My version is 1.x.3.

Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Sorry Barry didn't mean to break the house rules!

Edwin just to clarify what I meant by the header size was the total length including each of the record field schemas at the start of the file.

It seemed like too much of a coinsidence for there not to be something in it, but of course I haven't seen data files from other versions of the SCJD exam to confirm this.
[ September 28, 2006: Message edited by: Mark Smyth ]
Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
every .class file you generate contains a version stamp: two unsigned short integers starting at byte offset 4, right after the 0xCAFEBABE magic number. so assignment follows same path as far as version number and magic cookie are concerned.If interested see here..

http://www.javaworld.com/javaqa/2003-05/02-qa-0523-version-p2.html


SCJP 1.4<br />SCWCD 1.4(91%)<br />Working on SCJD -Bodgitt & Scrapper Constructions...<br /> <br />"It takes 43 muscles to frown & 17 to smile but it doen't take any to just sit there with a dumb look on your face .. Keep Smiling "
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: (Urlybird1.3.1) Magic cookie is Header Length