aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to decide header length from data file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to decide header length from data file ?" Watch "How to decide header length from data file ?" New topic
Author

How to decide header length from data file ?

Tien Fu Liu
Greenhorn

Joined: Jun 22, 2003
Posts: 8
Hi:
My question is based on the instruction as follows, how do you decide the header length?

Can I say the header length is simply as 4+4+2=10?

Thanks very much!

Start of file
4 byte numeric - magic cookie
4 byte numeric - length of the record
2 byte numeric - number of fields in each record

Schema Description
2 byte numeric - length in bytes of field name
n bytes - field name
2 bytes numeric - field length in bytes
repeat the above for every field in the record
Data Section
1 byte delete flag - 00 valid record, 0xFF deleted record
Record contains fields in the order specified, no seperators bet fields, each field is fixed length at maximum specified in schema information

End of file
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
It depends what you consider to be the "header". I use the term "header" for the portion of the file starting at the beginning of the file, up to the start of the first record. That is, the header includes the schema description section.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to decide header length from data file ?
 
Similar Threads
URLyBird Data File Format
URLyBird: How do I read in Deleted Flag?
how to read data from db file
.db file format problem, help please!!!
Can someone explain this in better english for me ?