adidng reading and writing files in binary format