Overview of the System.IO namespace
The .NET frameworks provide classes as well as other helper types such as enumerations, interfaces, and delegates that help us work with the filesystem objects as well as streams. These are grouped under the System.IO
namespace in the Base Class Library. The complete list of types is rather long, but the following tables show the most important of these grouped into several categories.
The most important classes for working with filesystem objects are as follows:
The most important classes for working with streams are as follows:
As you can see in the previous table, the concrete classes in this list come in pairs: a reader and a writer. Typically, these are used as follows:
BinaryReader
andBinaryWriter
are used to explicitly serialize and deserialize primitive data types to or from binary files.StreamReader
andStreamWriter
are used for handling character-based data, with different...