Hello All,
I have a code snippet written in Qt4. I want to port the following code to Qt3. I have given my attempt but the data what I get is "not complete". Since the data is binary, I assume a NULL character is encountered and terminates to read further.
Qt4 code
QFile fRead(inputFileName
);
return;
fRead.close();
QByteArray left16
= message.
left( 16 );
//get first 16 bytes QByteArray restRightAfter16
= message.
right( message.
length() - 16 );
QFile fRead(inputFileName);
if (!fRead.open(QIODevice::ReadOnly))
return;
QByteArray message = fRead.readAll();
fRead.close();
QByteArray left16 = message.left( 16 ); //get first 16 bytes
QByteArray restRightAfter16 = message.right( message.length() - 16 );
To copy to clipboard, switch view to plain text mode
Qt3 code
QFile fRead(inputFileName
);
if (!fRead.open(IO_ReadOnly))
return;
fRead.close();
QCString strleft16 = QCString( message.data() );
QCString strRestRightAfter16 = QCString( message.data() );
QByteArray restRightAfter16
= strRestRightAfter16.
right( strBody.
length() - 16 );
//I dont the full data into restRightAfter16. The data is incomplete.
QFile fRead(inputFileName);
if (!fRead.open(IO_ReadOnly))
return;
QByteArray message = fRead.readAll();
fRead.close();
QCString strleft16 = QCString( message.data() );
QByteArray left16 = strSalt.left( 16 );
QCString strRestRightAfter16 = QCString( message.data() );
QByteArray restRightAfter16 = strRestRightAfter16.right( strBody.length() - 16 ); //I dont the full data into restRightAfter16. The data is incomplete.
To copy to clipboard, switch view to plain text mode
The binary file is really large and I want to read the entire data as given in the code above. I dont have any problems with Qt4 code and it works very fine.
Where I'm I going wrong?
Thanks
Bookmarks