in my above code i have changed from QTextStream to QDataStream.

but i not able to write the file properly.
if the file is simple text file then it is written correctly but if it something else like .doc, .pdf etc. then i m not able to write to the file. the data written to the file is also not readable on the terminal as u might c from the code that i m also printing the data on the terminal and writing the same to the file simultaneously.

please tell me wat 2 do in that case. is it that this problem cant be solved without using QExtSerial ??