Hi,
I need to transfer data from a QIODevice to another. The simplest way is to read all the data from the source to memory, and write to the target .
Example:
target->write(source->readAll());
}
void copy(QIODevice *source , QIODevice *target){
target->write(source->readAll());
}
To copy to clipboard, switch view to plain text mode
However, the source may contains few hundred MB of data. It will hold a lot of memory during transfer. It is better to implement an async read and write operation , each time will only read/write a smalller amount of data. It should be not difficult to make by using bytesWritten and readyReady signal.
Before making my own class , I would like to ask is any there similiar class is already existed in Qt?
Thanks for any advise.
Bookmarks