[Interest] reading from and writing to a file with QDataStream

André Somers andre at familiesomers.nl
Tue Mar 8 20:31:40 CET 2016



Op 08/03/2016 om 20:27 schreef Nikita Krupenko:
> 2016-03-08 19:30 GMT+02:00 Thiago Macieira <thiago.macieira at intel.com>:
>> Indeed, but look at how you've combined two or more examples. You have a byte
>> array, you create a QDataStream on it, write some data, then you used
>> QDataStream to write that byte array to another byte array. You probably
>> didn't want that.
> It could be useful, if I want to write checksum of the data to the
> file. To do this, I can write
> some data to the QByteArray wrapped in QDataStream, then calculate
> checksum using
> qChecksum() (or QCriptographicHash) and then write byte array and
> checksum to the file.
Sure, it _could_ be useful, but it is not very likely that this is the 
kind of thing Sina was trying to do... So Thiago is right in saying that 
he _probably_ did not intend to do what he did.

André




More information about the Interest mailing list