Hi,

I have a large binary file consisting 3000x3000x2000 floating data points (around 67G in size). For each interval of 2000, I need to read one float value. So in total I need to read 3000x3000 points. What is the fastest way to read it?

I did the following way and it takes a decade to read it out.
Qt Code:
  1. QFile file( ... );
  2. QDataStream stream( &file );
  3.  
  4. qint64 pos( 0);
  5. char data[ 4 ];
  6. for ( int ix = 0; ix < 3000; ix++ ) {
  7. for ( int iy = 0; iy < 3000; iy++ ) {
  8. stream.device()->seek( pos );
  9. stream.readRawData( data, 4 );
  10. ...
  11. pos += 2000;
  12. }
  13. }
To copy to clipboard, switch view to plain text mode