c# - Is data “lost” when using binary data in a string?

后端 未结 9 1753
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-16 13:58

I\'ve tried reading a JPG file using the StreamReader class\' ReadToEnd() method which returns a string.

For some reason though, when I wri

9条回答
  •  醉梦人生
    2021-01-16 14:42

    Unfortunately there is a serious problem with class names in System.IO namespace. StreamReader is designed to read\write from\to text files. You should use FileStream for binary files as @goodwill suggested

提交回复
热议问题