Qt 6.11 is out! See what's new in the release
blog
QDatastream read raw data
-
-
There are two ways:
- Just use << / >> with QByteArray directly:
QByteArray to = ... out << to; QByteArray from; in >> from;- Or use writerawdata/readrawdata and store the array size, like:
QByteArray to = ... out << qint64(to.size()); out.writerawdata(..., size); QByteArray from; qint64 size = 0; in >> size; in.readrawdata(..., size);PS: I prefer the first way, if there no any restrictions/requirements for the file format.