Read binary files

Fixing 0x0d 0x0a input bytes malformed on Windows.
The other commit is just an optimization.