hey guys,
I'm trying to save a binary data as string in a QByteArray and for testing I used a simple text as my data and did the following:

Qt Code:
  1. QByteArray str2Store;
  2. QDataStream out(&str2Store,QIODevice::WriteOnly);
  3. out<<"salam";
  4. qDebug()<<str2Store;
To copy to clipboard, switch view to plain text mode 
now I should be expecting the string "salam" in str2Store variable but only a " is echod by qDebug,ofcourse str2Store.length() returns 10,why is the length 10? and why str2Store is not filled with the the string "salam"?