Hi, the format of the database file is actually: .db
I have got a little more progress on reading the file, I will briefly list what I did:
1. I read the .db file with RandomAccessFile or FileInputStream
2. According to the format of the Start of file section in the assignment spec, there are 4 bytes for magic cookie, 4 bytes for overall length for each record, and 2 bytes for number of fields. So I have create an array for each of these 'things', total of 3. To see what values they are, I first put the correct bytes into each array.
3. The 3 arrays now contains the bytes, then I convert them into
string and display them on screen.
The result is not useful at all, looks like '2 faces icon' and a 'f' sign, I do know that probably is because it is not text for display but just some information. But I do know you will need to know the overall length of each field to work out the position of each record in the .db file, but I cannot retrieve such infomation using this approach.
There are other problems when I just display everything of the .db file on screen, a field of data seems to be missing - location. Also there is no 'owner' for the very last record.
Mmm... many problems here for me, anybody else also having trouble like this?
I appreciate for any comments and advises. Thank you.