Yes you will need to change a bit.
I was not sure if you want to read the data from the serial port or from a file and send through serial port.
If you are getting the data through the serial port, then you can use QDataStream and QFile to save that binary data in its origianl binary form (not text).
EDIT:
by using QextSerialPort this is really easy, just few lines of code since both QextSerial and QFile are QIODevices, that you can use with QDataStream.
Bookmarks