You do not need or want to use QDataStream for this task. As Wysota points out a simple call to QIODevice::read() or readAll() will suffice. As mcosta points out you are flirting with crashing by using a char* pointer that is not initialised to point at allocated memory: Qt provides structures to handle this for you.

Your problem comes down to:
  1. Open file and report error if file not opened: See QFile and QIODevice open() and errorString().
  2. Read file content into memory. See QByteArray and QIODevice::read() or readAll().
  3. Close file. See QFile::close()
  4. Do something with content. See QByteArray::toHex()

That description is about the same length as a basic implementation.