How can I read a binary file in a Windows Store app, or more specifically how can I create my Stream, when the System.IO namespace contains no File class?
The documentation examples for BinaryReader unhelpfully use File!
How can I read a binary file in a Windows Store app, or more specifically how can I create my Stream, when the System.IO namespace contains no File class?
The documentation examples for BinaryReader unhelpfully use File!
You always access files in Windows Store apps using StorageFile class:
You can then get the binary contents of the file using the WinRT APIs:
If you want to use BinaryReader you need a stream instead:
Make sure you only use ReadBytes() for binary data in this case which doesn't take encoding into account.