fix binary files buffer