fix writeFile for binary
Merge pull request #5 from 7shi/master

fix writeFile for binary