Fix corrupted read data on Windows

Fixed bug when reading binary data on windows due to not opening the
file in binary mode. This now fixes the issue and the binary data is
read properly into the buffer.

fixes #245 updates #245