What about adding a pointer to a QDataStream member variable?
And then:
Qt Code:
  1. void SomeClass::initDataStream()
  2. {
  3. mDataStream = new QDataStream( yourByteArray );
  4. }
To copy to clipboard, switch view to plain text mode 
As for writing to the data stream, you can use:
Qt Code:
  1. *mDataStream << someInput;
To copy to clipboard, switch view to plain text mode 
This is pretty clear. Don't forget to delete the data stream when you're finished with it.

Regards