Originally posted by Marcelo Ortega: I see what you mean, but i don't see how you would use RandomAccessFile to read ALL rows? And if the answer is to use a DataInputStream, then how can i read a certain amount of bytes for each field like RandomAccessFile does? How do i read each row with a RandomAccessFile? Or is the trick to mix it with a DataInputStream...?
Kind regards, Mars.
I think the easyest way is to keep track of how many records (deleted and active) are in the file.
Then you will do something like the following:
To calculate the number of records would be something like:
numrecords= (fileSize - HeaderLength) / recordLength + 1 //Dont forget about active delete flag