copy a binary file

copying binary file with buffer