tntcoda
11th November 2008, 19:20
Hi,
I have a file with 400 bytes of data that i need to read in to a set of variables, the data is stored in the file exactly as it was in memory, so for example the first few bytes of the file are as follows:
2 bytes : unsigned short
255bytes : QByteArray
2 bytes : unsigned short
8 bytes: double
....
I need to read these bytes into variables of respective data types, and im a bit unsure how to do this.
Can anyone give me some pointers on how to approach this, i.e if i need to use text or data streams, or just QFile?
Thanks alot,
Jack
I have a file with 400 bytes of data that i need to read in to a set of variables, the data is stored in the file exactly as it was in memory, so for example the first few bytes of the file are as follows:
2 bytes : unsigned short
255bytes : QByteArray
2 bytes : unsigned short
8 bytes: double
....
I need to read these bytes into variables of respective data types, and im a bit unsure how to do this.
Can anyone give me some pointers on how to approach this, i.e if i need to use text or data streams, or just QFile?
Thanks alot,
Jack