Stream Basics and File I/O

In general, streams handle program input and program output. An input stream can be viewed as a sequence of bytes flowing into your program from a source device from which your program can read data. In contrast, an output stream can be regarded as a sequence of bytes to which your program can write that flows out from your program and are delivered to a destination device.

In C# and .NET, streams are represented by objects instantiated from stream classes located in the System.IO namespace.

You Have Already (Unknowingly) Used Streams

By default, our familiar Console.ReadLine method reads from a standard input stream (an ...

Get C# Primer Plus 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.