Working with Input/Output Streams

The System.IO namespace provides classes for reading and writing data into and from streams, including files, network streams, and so on. The Stream class provides an abstract representation of sequence of bytes. Typically you would work with a reader/writer pair of classes, which provide methods to read and write primitive typed and/or string to/from the stream. For example, the BinaryReader/BinaryWriter and StreamReader/StreamWriter classes provide reading/writing binary data and text, respectively. Additionally, StringReader/StringWriter classes provide reading/writing from a string, typically useful for manipulating in memory data. Apart from that, the System.IO namespace provides Directory, DirectoryInfo, ...

Get Microsoft® .NET Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.