Hello!
Thank you very much for the replies to my inquiries.
This is in connection to my previous posts here and here.
I am now successful on obtaining the correct data from a Binary file using RandomAccessFile. However, I could not seem to understand why I couldn't get the last record (or imaginary row) of my binary file.
My program just reads data from an Excel then writes/appends each field to a Binary File. On writing to the Binary file, I use DataOutputStream. Then on reading, I use RandomAccessFile as abovementioned. My excel has 100 records. Theoretically, I should expect 100 records as well, written in the binary file. But my program prints 99 records only. I checked the sizes after writing using DataOutputStream's size() and before reading using RandomAccessFile's length() and they're the same.
Here's my loop on reading the binary file:
I hope you could point to me if there's something wrong with my approach, I would really appreciate it.
Thanks in advance!>
Thank you very much for the replies to my inquiries.
This is in connection to my previous posts here and here.
I am now successful on obtaining the correct data from a Binary file using RandomAccessFile. However, I could not seem to understand why I couldn't get the last record (or imaginary row) of my binary file.
My program just reads data from an Excel then writes/appends each field to a Binary File. On writing to the Binary file, I use DataOutputStream. Then on reading, I use RandomAccessFile as abovementioned. My excel has 100 records. Theoretically, I should expect 100 records as well, written in the binary file. But my program prints 99 records only. I checked the sizes after writing using DataOutputStream's size() and before reading using RandomAccessFile's length() and they're the same.
Here's my loop on reading the binary file:
I hope you could point to me if there's something wrong with my approach, I would really appreciate it.
Thanks in advance!>