Hi Roel,
Good News!!
Finally, I could read successfully first 3 items using RandomAccessFile:-) and compare the output with that generated from the DB File Reader Tool from Roberto.
Can you please validate?
Output:
Magic cookie value is 514
Offset to start of record zero 70
No of Fields in each record 6
Question#1: Can you please verify/confirm if first 4 bytes are for Magic Cookie, next 4 bytes are for Rec Length and next 2 bytes are for "No of Fields in each record".
Am i in the right direction?
Qustion #2 : The second entry output of "70", is this for "offset to start of record zero" or "record length"? I am confused;-( what exactly is offset ? please explain a little bit about offset?
Question#3 : Are there any spaces between the entries in the DB file? If so, how to skip spaces and jump to next entry using Random Access File?
FYI, My data file format:
*********************
Start of file
4 byte numeric, magic cookie value identifies this as a data file
4 byte numeric, offset to start of record zero
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. (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
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
*********************
Thanks,