schunyeh
24th December 2014, 00:30
Hi, all,
I have a problem of QByteArry.
When I take it to store a data, a strange binary file is outputted.
A basic code is like as following.
QString fname ="test1.db";
QFile ext_file(fname);
ext_file.open(QIODevice::WriteOnly);
QDataStream out(&ext_file);
static const char mydata[] = { 0x74,0x68,0x65 };
QByteArray data = QByteArray::fromRawData(mydata,sizeof(mydata));
out<<data;
However, I got a strange extra data on the head of data stream.
0000 0003 7468 65
Why does the output data have 0000 0003 ?
Could you please help me.
Thank you very much.
I have a problem of QByteArry.
When I take it to store a data, a strange binary file is outputted.
A basic code is like as following.
QString fname ="test1.db";
QFile ext_file(fname);
ext_file.open(QIODevice::WriteOnly);
QDataStream out(&ext_file);
static const char mydata[] = { 0x74,0x68,0x65 };
QByteArray data = QByteArray::fromRawData(mydata,sizeof(mydata));
out<<data;
However, I got a strange extra data on the head of data stream.
0000 0003 7468 65
Why does the output data have 0000 0003 ?
Could you please help me.
Thank you very much.