In c#, System.IO is a namespace and it will contain a standard IO (input/output) types such as classes, structures, enumerations, and delegates to perform a read / write operations on different sources like file, memory, network, etc.
Following are the different type of classes which exists in System.IO namespace to perform different operations like creating files, writing to files, reading from files, etc.
Class | Description |
---|---|
BinaryReader | This class is useful to read primitive data types from a binary stream. |
BinaryWriter | It is useful to write primitive types in binary format. |
BufferedStream | This class is useful to read and write bytes from other streams. |
Directory | This class provides methods to manipulate the directories and subdirectories like create, move, etc. |
File | This class provides a methods to manipulate the files like create, copy, delete, move and open a file. |
FileStream | This class is useful to read or write bytes from/to a file. |
MemoryStream | This class is useful to read or write bytes that are stored in memory. |
Path | This class is useful to perform operations on directory path information. |
Stream | This class is an abstract class and it will provide a methods to transfer bytes to the source. |
StreamReader | This class is useful to read a characters from stream by converting bytes into characters using an encoded value. |
StreamWriter | This class is useful to write a characters to stream by converting characters into bytes using an encoded value. |
StringReader | This class is useful to read from a string. |
StringWriter | This class is useful to write information to string. |
TextReader | This class is useful to read a sequential series of characters. |
TextWriter | This class is abstract and it is useful to write a sequential series of characters. |
Following are the different type of structures which exists in System.IO namespace.
Structure | Description |
---|---|
WaitForChangedResult | This structure will contain information on the change that occurred. |
Following are the different type of enumerations which exists in System.IO namespace.
Enumeration | Description |
---|---|
DriveType | This will define a constants for drive types. |
FileAccess | It defines constants for reading, write, or read/write access to a file. |
FileAttributes | It provides attributes for files and directories. |
FileMode | It will specify how an operating system will open the file. |
FileOptions | It will provide an advanced options for creating a filestream object. |
FileShare | It will contain constants to control the access of filestream objects. |
HandleInheritability | It is useful to specify whether the underlying handle is inheritable by child processes. |
NotifyFilters | It will specify the changes to watch for in a file or folder. |
SearchOption | It will specify whether to search the current directory or the current directory and all subdirectories. |
SeekOrigin | It will specify the position in a stream to use for seeking. |
WatcherChangeTypes | It will specify the changes that might occur to a file or directory. |
Following are the different type of delegates which exists in System.IO namespace.
Delegate | Description |
---|---|
ErrorEventHandler | This will represent a method that will handle the error event of a FileSystemWatcher object. |
FileSystemEventHandler | It will represent a method that will handle the changed, created, or deleted event of a FileSystemWatcher class. |
RenamedEventHandler | It will represent a method that will handle the renamed event of a FileSystemWatcher class. |
This is how the System.IO namespace contains different types to perform a read / write operations on different sources like file, memory, network, etc.