That depends on the contents of your input file.
Could you please clarify what you mean by "written as bytes or a bytearray"?

Basically: You need to read them "inverse to the way you wrote them", convert that bytearray into a QString and then write that (in the desired encoding) to your output file.