#include <QtCore/QCoreApplication>
#include <QFile>
#include <QDebug>
#include <QDataStream>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QFile aa;
aa.setFileName("1.dat");
aa.open(QIODevice::ReadWrite);
QDataStream ss(&aa);
qint64 pos[10];
for (int i=0;i<10;++i)
{
pos[i] = aa.pos();
ss << i + 10;
}
for (int i = 0; i < 10; ++i)
{
aa.seek(pos[i]);
int x = 0;
ss >>x;
qDebug() << x;
}
aa.close();
return a.exec();
}