How to write back binary file to the unit?