title: Append a QByteArray to QDataStream?
body: <p>I have to populate a <code>QByteArray</code> with different data. So I'm using the <code>QDataStream</code>.</p>
  
  <pre><code>QByteArray buffer;
  QDataStream stream(&amp;buffer, QIODevice::WriteOnly);
  
  qint8 dataHex= 0x04;
  qint8 dataChar = 'V';
  
  stream &lt;&lt; dataHex&lt;&lt; dataChar;
  qDebug() &lt;&lt; buffer.toHex();  // "0456"  This is what I want
  </code></pre>
  
  <p>However, I would also like to append a QByteArray to the <code>buffer</code>.</p>
  
  <pre><code>QByteArray buffer;
  QDataStream stream(&amp;buffer, QIODevice::WriteOnly);
  
  qint8 dataHex= 0x04;
  qint8 dataChar = 'V';
  QByteArray moreData = QByteArray::fromHex("ff");
  
  stream &lt;&lt; dataHex&lt;&lt; dataChar &lt;&lt; moreData.data(); // char * QByteArray::data ()
  qDebug() &lt;&lt; buffer.toHex();  // "045600000002ff00"  I would like "0456ff"
  </code></pre>
  
  <p>What am I missing?</p>