C++ (Qt)QFile srcchar *c;int len;char data[255];bool ok; len = 0; while(1){ ok = (src.getChar(c) && c); if (!ok) break; Debug() << "Read:\t" << QByteArray::fromRawData (c, 1).toHex() << "\tlen" << len; data[len] = *c; ++len; if (len == maxlen) break; }
C++ (Qt)QBitArray *ba = new QBitArray(100, false); QFile *file = new QFile("out");if (!file->open(QIODevice::WriteOnly)) {cerr << "Can not create file" << endl;return;} QDataStream *outstream = new QDataStream(file); *outstream << *ba;