Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
4 byte numeric, total overall length in bytes of each record
2 byte numeric, number of fields in each record
Schema description section.
Repeated for each field in a record:
2 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
2 byte numeric, field length in bytes
end of repeating block
Data section.
Repeat to end of file:
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
End of file
Repeat to end of file:
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record
2 byte numeric, length in bytes of field name
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
The magic cookie does appear to be tied to the version number, but in a funny way. It appears that the magic cookie is the hexadecimal representation of your assignment version number, without the middle digit. So, since you have assignment version 2.1.1 I would expect you to have a magic cookie of 0x0201 which in decimal = 513My assignment version is 2.1.1 and i hear that your magic cookie value was tied to the version of your assignment!
Well the output was
Magic Cookie value : 513
Total Length : 182
Field Size : 6
I was expecting a magic cookie value of like 211!(Was just expecting: I do hope i read it correctly) If the total length is 182 does it include the [delete flag].
Sorry, I don't understand what you are asking for here.Is it possible to get a diagrammatic representation of what happens when u read a file say with the readInt() method, i know it skips after it reads!
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Data section.
Repeat to end of file:
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
ExcellentI have been able to read the field names !
As mentioned in another topic recently - it is quite possible that Sun are deliberately trying to emulate clueless spec-writersMy concern is the above statement from the schema, is the 1 bytein the beginning or @ the end of the file and again it says that.. no separators between fields, each field fixed length at maximum specified in schema information, i am getting the feeling all the information are jumbled together , it this right?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
name
byte flag 0
ocation @ ?specialties @ ?size ? ?rat ?owner Buonarotti & Company
Smallville Air Conditi
oning, Painting, Painting 10 $40.00 Swan
ders & Flaughn Smallville
Painting, Air Conditioning 7
$55.00 Moore Power Tool Ya Whoville
Air Conditioning
7 $65.00 Hamner & Tong Whovil
le Roofing, Carpets, Elec
trical 9 $90.00 Bitter Homes &
Gardens Metropolis
Electrical, Plumbing 5 $45.00
Buonarotti & Company Metropolis
Heating, Carpets
4 $75.00 Hamner & Tong Pleasantville
Drywall
5 $90.00 Bitter Homes & Gardens
Pleasantville Drywall, E
lectrical, Carpets 5 $50.00 Bit
ter Homes & Gardens Digitopolis
Electrical 4
$55.00 Fred & Nobby Digitopolis
Roofing
3 $75.00 Dogs With Tools Digit
opolis Electrical, Glass, Gl
ass 3 $75.00 Moore Power To
ol Ya Atlantis
byte flag 32
null
Magic Cookie value 513
Total Length 182
Field size 6
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Consider Paul's rocket mass heater. |