QDataStream freely. Under qt3, there's no mechanism to make sure the underlying FILE * gets flushed between an fread() and an fwrite(), and so the data gets written at the wrong location.