Use binary streams for improved portability

Seeing issues with Windows inserting extra newline characters for example,
we could also look into other alternatives but this seemed like an easy
fix.

Change-Id: I6d4606078429eccac2c962d6d409818632cb90ed
Merge topic 'binary-streams' into master

884999d0 Use binary streams for improved portability