[quote author="Iama Hummingbird" date="1315081309"]OK pepe. But does your comment mean that a QByteArray can hold data up to 2GB? I thought QByteArray can only hold up to 32K bytes since the size is based on integer.[/quote]
"int" is a 32 bit signed integer on all platforms supported by Qt. Therefore, you can index (and store) up to 2^32-1 bytes inside a QByteArray. Which means up to 2GB - 1B. That's why I was asking for an use case -- allocating a single, huge chunk of 2GB is not that common.
[quote]
Some of the standard examples are having webpages 'readAll()' into a QByteArray through QNetworkReply. But many web pages have more data than 32K or more characters than 32K so if put into a QString, the webpage would be amputated.
[/quote]
See above for the 32K part. But I think that this is quite a corner case, and you won't wait to buffer 2GB in memory before attempting to read it all at once -- you will read it as soon as possible (i.e. just after readyRead is emitted). This way you can safely download files even bigger than 2GB.