Champion, do you mean something like reading the information related to the fields in runtime? If so, please take a look at the DBFileReader tool, which is a tool I created to read the database that is provided in the assignment, and has this approach. I myself chose to hardcode the values of each field in an interface that has some constants related to the database, and is also implemented by the Data class.
Although it is not a bad ideea to do read the lengths of the fields by using the first 74 bytes of the file, and parsing each column name and length piece by piece. I think i'll stick with the static variables option. Nowhere in the assignment does it state that the field lengths are subject to change, so that leads me to believe it is a safe approach ... though it can be improved.
There's one more thing i'd like to add in case someone misses it ( like i did in the first place :-) ) :
THE BYTES FROM 4-8 SPECIFY THE LENGTH TO THE FIRST RECORD, COUNTING FROM BYTE 0 OF THE FILE.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com