QFile::readAll() returs the file's content and moves the "file pointer", i.e. positions the seek position at the end of the file.
So your two subsequent readAll() calls have different results.
Something like this would probably be better
// on the stack unless you really need the file to remain open after the method ends.
MonArray->resize(40000000);
MonBUffer->setData(MonArray);
}
// on the stack unless you really need the file to remain open after the method ends.
QFile MonFichier(QString("C:/SPLIT/ORIGINAL.wav.001"));
MonFichier.open(QIODevice::ReadOnly);
QByteArray MonArray = MonFichier.readlAll();
MonArray->resize(40000000);
QBuffer* MonBuffer = new QBuffer(this);
MonBUffer->setData(MonArray);
MonBuffer->open(QIODevice::ReadWrite);
}
To copy to clipboard, switch view to plain text mode
If you are downloading the file using some Qt I/O classes, you might be able to skip writing to a file, i.e. write the recieved data into the buffer object directly
Cheers,
_
Bookmarks