I've spent a few hours searching for example code but no real luck - maybe someone can put me on the right direction.
Simply trying capture data coming in and when it's all arrived, write it out to a binary file, but in published byte-position-sensitive format. Format conversion if you like.
So to keep things organized as there's a large amount of data, I'm thinking of filling in structures from the incoming stream and when everything has arrived, dumping out the structures one-by-one. Eg a structure for the header followed by structures for the records etc...
But also in the binary output file will be offsets to where these structures start. I'm concerned as what mechanism to use to ensure no unexpected byte-padding or arrangement occurs. Or is this something I'd have to go to something like C++ for?
Simply trying capture data coming in and when it's all arrived, write it out to a binary file, but in published byte-position-sensitive format. Format conversion if you like.
So to keep things organized as there's a large amount of data, I'm thinking of filling in structures from the incoming stream and when everything has arrived, dumping out the structures one-by-one. Eg a structure for the header followed by structures for the records etc...
But also in the binary output file will be offsets to where these structures start. I'm concerned as what mechanism to use to ensure no unexpected byte-padding or arrangement occurs. Or is this something I'd have to go to something like C++ for?