posted 18 years ago
Shan,
I personally read the two bytes indicating a deleted flag before reading the rest of the record from the file - that way you can read the two bytes directly into a byte array (bypassing the need for conversion) and check if the record is deleted or not.
The added bonus of this approach is that if you determine a record is deleted you do not need to read the rest of the record, and accordingly save valuable time synchronizing and reading the DB file.
Best wishes,
Daniel
SCJP 1.4,<br />SCJD (URLyBird 1.2.1, JDK 5.0)