The System::IO Namespace


The System::IO Namespace

The System::IO namespace contains all the classes that are used for binary and text I/O, as well as classes that help you to work with files and directories. The following table lists the main classes in the namespace.

Class

Description

BinaryReader

Reads primitive data types as binary values

BinaryWriter

Writes primitive data types as binary values

BufferedStream

A stream class that buffers reads and writes to another stream

Directory

Has static methods for working with directories

DirectoryInfo

Has nonstatic methods for working with directories

File

Has static methods for working with files

FileInfo

Has nonstatic methods for working with files

FileStream

A class for reading and writing files using a stream

FileSystemInfo

The abstract base class for DirectoryInfo and FileInfo

FileSystemWatcher

Watches for changes to the file system and raises events when changes occur

IOException

The exception thrown by classes in the System::IO namespace

MemoryStream

A stream class that reads and writes memory

Path

Helps you work with directory strings in a platform-independent way

Stream

The abstract base class for all the stream classes

StreamReader

A TextReader that reads characters from a byte stream

StreamWriter

A TextWriter that writes characters to a byte stream

StringReader

A TextReader that reads from a string

StringWriter

A TextWriter that writes to a string

TextReader

The abstract base class for StreamReader and StringReader

TextWriter

The abstract base class for StreamWriter and StringWriter

The I/O-oriented classes in System::IO can be divided into the following three groups:

  • The Stream classes, which are designed for I/O of streams of bytes

  • The BinaryReader and BinaryWriter classes, which are used to input and output .NET primitive types, such as Int32 and Double, in binary form

  • The TextReader and TextWriter classes, which are used for character- mode I/O

This chapter focuses on the latter two groups.




Microsoft Visual C++  .NET(c) Step by Step
Microsoft Visual C++ .NET(c) Step by Step
ISBN: 735615675
EAN: N/A
Year: 2003
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net