C# using streams

后端 未结 7 1656
一整个雨季
一整个雨季 2020-12-07 09:38

Streams are kind of mysterious to me. I don\'t know when to use which stream and how to use them. Can someone explain to me how streams are used?

If I understand cor

相关标签:
7条回答
  • 2020-12-07 10:05

    I wouldn't call those different kind of streams. The Stream class have CanRead and CanWrite properties that tell you if the particular stream can be read from and written to.

    The major difference between different stream classes (such as MemoryStream vs FileStream) is the backing store - where the data is read from or where it's written to. It's kind of obvious from the name. A MemoryStream stores the data in memory only, a FileStream is backed by a file on disk, a NetworkStream reads data from the network and so on.

    0 讨论(0)
提交回复
热议问题