[Qt-interest] Writing to a binary file

Plato P.B. platodreams at gmail.com
Thu Feb 10 21:21:57 CET 2011


Hi,

Here I am trying to write data to a binary file.

derFile, signresult, zipSignCrx are of QByteArray format. The problem
is the first element of QByteArray is the array size. I dont need that
array size to go into that file. Is there anyway I could possible
achieve that.



QFile crxFinal(location + "/" + ui->lineEdit->text() + ".crx");

crxFinal.open(QIODevice::WriteOnly);

 QDataStream crxout(&crxFinal);

 crxout << quint32(0x43723234) << quint32(0x02000000) <<
quint32(0xA2000000) << quint32(0x80000000) << quint32(0x30819F30) <<
quint32(0x0D06092A) << quint32(0x864886F7) << quint32(0x0D010101) <<
quint32(0x05000381) << quint16(0x8D00) << derFile << signresult <<
zipSignCrx;

crxFinal.close();


I am trying to write binary data to this file. So i cant use
textstream i guess! This code works perfectly other than the unneeded
array size.




Thanks in Advance!

-- 






*Thanks & Regards,*

Plato P.B.
obscurant1st.biz/blog
coolfacts.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110211/13ac9e45/attachment.html 


More information about the Qt-interest-old mailing list