I have to read binary file via Qt. In console application I make

Qt Code:
  1. FILE * fid5 = fopen ("./test_data/source.rgg", "rb");
  2.  
  3. ...
  4. for (int i=1; i<=na; i++)
  5. {
  6. fread (st+i-1, sizeof (unsigned long), nd2, fid5);
  7. ...
  8. }
To copy to clipboard, switch view to plain text mode 

and all work fine. In Qt application I try
Qt Code:
  1. QString fileName = QFileDialog::getOpenFileName (this, tr("Select
  2. source file"), QDir::currentPath(), tr("All files (*)"));
  3. if (fileName.isEmpty())
  4. return;
  5. ...
  6.  
  7. QFile * fData = new QFile (fileName);
  8.  
  9. for (int i=1; i<=na; i++)
  10. {
  11. char * colData = new char [nd2*sizeof (unsigned long)];
  12. qint64 colLength = fData->readLine (colData, nd2*sizeof
  13. (unsigned long));
  14. if (colLength < 0)
  15. {
  16. qDebug () << __PRETTY_FUNCTION__ << QString ("Read error");
  17. continue;
  18. }
  19. QByteArray buff (colData);
  20. delete [] colData;
  21. //qDebug () << __PRETTY_FUNCTION__ << i << buff;
  22.  
  23. QBuffer lBuf (&buff);
  24. lBuf.open (QIODevice::ReadOnly);
  25. QDataStream numStr (&lBuf);
  26. quint64 num;
  27. for (int ii=0; ii<nd2; ii++)
  28. {
  29. numStr >> num;
  30. qDebug () << __PRETTY_FUNCTION__ << num;
  31. st[ii] = num;
  32. }
  33. ...
  34. }
To copy to clipboard, switch view to plain text mode 

And for the same file in debug numbers do not read properly.
Thanks a lot.