Qt Framework includes a class called QBuffer that can be used to access a QByteArray (internal QByteArray to be precise) as if it is a file. So you can use Stream readers and writers to access data in it similar to a QFile.
Here is a brief example:
QBuffer b;
b.open(QBuffer::ReadWrite);
b.write("http://amin-ahmadi.com");
qDebug() << b.size(); // 22
b.seek(0);
qDebug() << b.read(11); // "http://amin"
b.seek(20);
qDebug() << b.read(1); // "o"
b.close();