Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
qint64 QIODevice::read(char *, qint64) and friends require the user to make sure that the buffer is large enough or valid, hence they are rather unsafe. Their overloads returning QByteArray cause a new buffer (within QByteArray) to be allocated.
If QIODevice had the following overloads it would be possible to reuse the capacity of an already available QByteArray instance safely:
qint64 QIODevice::read(QByteArrray *); qint64 QIODevice::readAll(QByteArrray *); qint64 QIODevice::readLine(QByteArrray *); qint64 QIODevice::peek(QByteArrray *);
These overloads would make all sorts of data processing applications perform better.