File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to decide header length from data file ?

 
Tien Fu Liu
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic