[Qt-interest] Writing to a binary file

Jason H scorp1us at yahoo.com
Thu Feb 10 21:38:20 CET 2011


There are
QIODevice::[read/write]RawData() functions...



________________________________
From: Plato P.B. <platodreams at gmail.com>
To: qt-interest at qt.nokia.com
Sent: Thu, February 10, 2011 3:21:57 PM
Subject: [Qt-interest] Writing to a binary file


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/20110210/5de9bf87/attachment.html 


More information about the Qt-interest-old mailing list