Stream in C#
A stream is an object used to transfer data. There is a generic stream class System.IO.Stream, from which all other stream classes in .NET are derived. The Stream class deals with bytes.
The concrete stream classes are used to deal with other types of data than bytes. For example:
- The
FileStreamclass is used when the outside source is a file MemoryStreamis used to store data in memorySystem.Net.Sockets.NetworkStreamhandles network data
Reader/writer streams such as StreamReader and StreamWriter are not streams - they are not derived from System.IO.Stream, they are designed to help to write and read data from and to stream!
Comments
Post a Comment