Streams

In C#, streams are objects that are read from and written to. They are often associated with files but can also be used for memory storage or network communication. Streams abstract the underlying details of operating system, firmware, and hardware I/O. This lets programmers concentrate on what information needs to be processed, rather than how it's processed.

All C# streams are derived from the Stream class. Examples in this section focus on the FileStream, BufferedStream, StreamReader, StreamWriter, and CryptoStream. However, the concepts are easily translated to other streams, such as BinaryReader, BinaryWriter, MemoryStream, StringReader, and StringWriter classes. The NetworkSream is demonstrated in a later chapter. Table 17.6 lists ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.