Don't use QDataStream, it's a serialization mechanism, not a general purpose binary stream.