Hey all.
this is part of my code
QDataStream data(&arr,QIODevice::ReadWrite);
data.setVersion(QDataStream::Qt_4_6);
data<<(quint16(0))<<quint8('S');
data<<message;
data<<(quint8('L'));
data.device()->seek(0);
data<<(arr.size()-sizeof(quint16));
data.device()->seek(0);
QString a;
quint8 type1,type2;
quint16 size;
data>>size>>type1>>a>>type2;
ui->textBrowser->append(QString::number(size));
ui->textBrowser->append(QString::number(type1));
ui->textBrowser->append(a);
ui->textBrowser->append(QString::number(type2));
message is a non empty QString;
arr is a ByteArray;
On the text browser i get the output as
0
0
0
Exactly as above.
what is happening to all the data im writing! why is it all showing 0??
Please help
Im actually writing this data block over a stream using TCPsocket, but i wasnt reciving any data at the other end, so i just did the above to see if data is being written at the source!!
Bookmarks