O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required