个人资料
yu_jianfang
博客等级:
博客积分:0博客访问:6,596关注人气:0获赠金笔:0支赠出金笔:0支荣誉徽章:
相关博文

杂谈

QDataStream读写数据
1 QFilefile("c:/a");
3 file.open(QIODevice::ReadOnly);
5 QDataStream out(&file);//readthedataserializedfromthefile
7 QByteArraybarr;
9 QFilefile2("c:/b");
11 file2.open(QIODevice::WriteOnly);
13 int maxSize=1024;
15 char* datas=new char [maxSize];
17 while(!out.atEnd())
19 {
21 int actuallyRead=out.readRawData(datas,maxSize);
23 barr.append(datas,actuallyRead);//QMessageBox::information(this,"","a","");
25 }
27 delete[]datas;QMessageBox::information(this,"",QString(barr),"");
29 file2.write(barr);
31 file.close();
33 file2.close();
喜欢
赠金笔
评论加载中,请稍候...
发评论
评论并转载此博文
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。