Hello,
I am new to Qt programming.

This is my question:
when using a byte array in this way:

QByteArray Message;
QDataStream stream(&Message,QIODevice::WriteOnly);

Using the stream to perform certain actions.

later i want to use "stream" to readonly, or handle another ByteArray.

How is this done?

Ive tried

stream.device()->close();
stream.device()->setOpenMode(QIODevice::ReadOnly);


all give errors.

Thanks
Aashish