write file in binary way
read from binary file