There is a universal binary (and compact) notation called ASN.1. It has been widely used, and there are books about it. ASN.1 can be compared to XML, but at a lower (more primitive but more flexible) level than XML. And XML, especially the binary XML mentioned above, would also help you a lot. Also, if your file contains no more than one sequence of data, see Solid File System as a container for multiple data streams in a single file.
source
share