[Qt-interest] QDataStream writing a quint32 twice
Volker
volker at openbios.org
Fri Dec 11 18:58:44 CET 2009
On Friday 11 December 2009 16:23:00 you wrote:
> Thanks a lot everybody for helping me figuring this out. Guess I should
> consult the Qt documentation more often. However, in subsequent releases,
> the size field wont be adjacent to the data header. Hence, just using '
> out<<newString.toAscii() ' wont help. I need to write the 'size' first:
>
> out<<someByteArray.size();
> out<<(quint32)someData;
> //Write data from someByteArray to QDataStream.
>
> How do I go about it now, without writing the size of ' someByteArray ' to
> QDataStream?
>
For example:
out.writeRawData( someByteArray.constData(), someByteArray.size() );
More information about the Qt-interest-old
mailing list