read a binary file