QDataStream is, in general, expecting to be reading a data stream created by another QDataStream. If just want to read raw bytes then use QIODevice directly.

The QDataStream output of a QByteArray contains bytes other than just the content of the array. Consequently, when asked to read a QByteArray it expects those extra bytes. QByteArray serialises the size of the array as a 32-bit integer before the content itself so the receiver can know where the data ends.
Qt Code:
  1. #include <QCoreApplication>
  2. #include <QDataStream>
  3. #include <QBuffer>
  4. #include <QDebug>
  5.  
  6. int main(int argc, char **argv)
  7. {
  8. QCoreApplication app(argc, argv);
  9.  
  10. // Load a test QByteArray with 8 bytes
  11. QByteArray payload = QByteArray::fromHex("3031323334353637");
  12.  
  13. // Serialise it using QDataStream
  14. QBuffer buffer;
  15. buffer.open(QIODevice::WriteOnly);
  16. QDataStream out(&buffer);
  17. out << payload;
  18.  
  19. // What went into the buffer?
  20. qDebug() << buffer.buffer().toHex();
  21.  
  22. // Output: "000000083031323334353637"
  23. return 0;
  24. }
To copy to clipboard, switch view to plain text mode 


In your example the input hex string is 31 digits (odd) and QByteArray has assumed a leading zero. The data array contains bytes (hex): 02 00 00 00 08 30 53 70 ff ff ff 63 05 00 00 8e
The first four bytes will be consumed as a size (a very big one), and the content will start at 0x08.
On my machine convertedStr is empty, probably because the input stream was exhausted before 0x02000000 bytes could be read.