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.
qint64 pos( 0);
char data[ 4 ];
for ( int ix = 0; ix < 3000; ix++ ) {
for ( int iy = 0; iy < 3000; iy++ ) {
stream.device()->seek( pos );
stream.readRawData( data, 4 );
...
pos += 2000;
}
}
QFile file( ... );
QDataStream stream( &file );
qint64 pos( 0);
char data[ 4 ];
for ( int ix = 0; ix < 3000; ix++ ) {
for ( int iy = 0; iy < 3000; iy++ ) {
stream.device()->seek( pos );
stream.readRawData( data, 4 );
...
pos += 2000;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks