-
On QFile::readAll()
I have a code like this:
[CODE]
QByteArray content= file->readAll();
qDebug()<<"File size is "<<file->size();
qDebug()<<"Array1 size is "<<content.size();
[/CODE]
I got the result:
File size is 77274
Array size is 1543
I have also get this:
[CODE]
file->write(reply->readAll());
qDebug()<<"readAll() size is "<<reply->readAll().size();
[/CODE]
The file content is normal, but readAll() size is 0
This why. I think readAll() will read all lines from the file and they should at least has similar size.
-
Re: On QFile::readAll()
Got the answer: QFile is derived from QIODevice, which once "readAll()", the source data is flushed.
So I change it to: QByteArray bArray = reply->readAll()
and use bArray to do everything later.