Data file Format
The format of data in the database file is as follows:
Start of file
4 byte numeric, magic cookie value identifies this as a data file
(what is magic cookie? i used BufferedReader to read the file, and i did not see
any magic cookie! please tell me how to find it!)
4 byte numeric, offset to start of record zero
(what does it mean?)
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
(does the above mean that each record has 2 spaces between them, and the length of each record
is the sum of length of the each feild?)
Data section. offset into file equal to "offset to start of record zero" value
Repeat to end of file:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
(how to assign byte with '00' and '0x8000 '? is the 2 bytes flag the spaces between each 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
All numeric values are stored in the header information use the formats of the DataInputStream
and DataOutputStream classes. All text values, and all fields (which are text only), contain
only 8 bit characters, null terminated if less than the maximum length for the field. The character
encoding is 8 bit US ASCII.
(what is header section? and how to get the header section? should i use DataInputStream and DataOutputStream to read and write the
.db file? what does "null terminated if less than the maximum length for the field" mean?
what is "The character encoding is 8 bit US ASCII"?)
thank you in advance