Is this a text file? Because if not, you shouldn't use QTextStream. And even if it is a text file, you shouldn't use QTextStream with the stream operator (you'll lose whitespaces, etc.).
I guess this would be a bit better:
Qt Code:
QByteArray data; while(!sourceFile.atEnd()){ data = sourceFile.read(64*1024); // read 64kB data = qCompress(data); destFile.write(data); }To copy to clipboard, switch view to plain text mode





Reply With Quote
Bookmarks