DiamonDogX
18th May 2009, 16:19
I have a file that I wrote bytes to (MyFile below)... these bytes were actually just xml text originally, but were written as bytes or a bytearray. My question is how would I take those raw bytes and write them as the xml text they represent to a different file?
QFile fileReadIn ("MyFile");
if (fileReadIn.open( QFile::ReadOnly ))
{
QFile testFile( "Result.xml" );
testFile.open( QIODevice::WriteOnly );
testFile.write(fileReadIn.readAll());
}
QFile fileReadIn ("MyFile");
if (fileReadIn.open( QFile::ReadOnly ))
{
QFile testFile( "Result.xml" );
testFile.open( QIODevice::WriteOnly );
testFile.write(fileReadIn.readAll());
}