C++ (Qt)QDataStream::QDataStream ( QIODevice * d )
void ProcessData(){ /* Try to open dest file... */ QFile myFile(destFileName); if ( !myFile.open(QIODevice::WriteOnly) ) ThrowException(etFailedToOpenOutputFile, "Failed to open output file!"); /* Try to process data. Fill buffers here... */ // ... // ... // ... /* Finalizing... */ FlushProcessedData(); myFile.close();}
QBuffer buf_Packet_0; QBuffer buf_Packet_1; QBuffer buf_Packet_2; ....
buf_Packet_0.buffer().resize(0); buf_Packet_1.buffer().resize(0); buf_Packet_2.buffer().resize(0); ...
C++ (Qt)buf_Packet_0 = QBuffer();buf_Packet_0.setBuffer(QByteArray());
void DoSomething(){ ... QList<QBuffer*> bufferList; for ( int i = 0; i < n; i++ ) { QBuffer tmpBuffer; // do something here bufferList.push_back(&tmpBuffer); } /* Buffer list processing here... */ ...}