Friday, 4 May 2012

Beginning .Net : IO Readers and Writers in .Net

Main parts of I/O in the .NET Framework are Reader and Writer classes. These classes help the reading and writing of individual bytes to and from Streams.
The .NET Framework provides a wide variety of reader and writer classes, each designed for reading or writing according to a specific set of rules.
Following Table shows a partial list of the readers available in the .NET Framework and the corresponding writer classes.

CLASS DESCRIPTION
System.IO.TextReader Abstract class that enables the reading of a sequential series of characters.
System.IO.StreamReader Reads characters from a byte stream. Derived from TextReader.
System.IO.StringReader Reads textual information as a stream of in-memory characters. Derived from TextReader.
System.IO.BinaryReader Reads primitive data types as binary values from a stream.
System.Xml.XmlTextReader Provides fast, non-cached, forward-only access to XML.
System.IO.TextWriter Abstract class that enables the writing of a sequential series of characters.
System.IO.StreamWriter Writes characters to a stream. Derived from TextWriter.
System.IO.StringWriter Writes textual information as a stream of in-memory characters. Derived from TextWriter.
System.IO.BinaryWriter Writes primitive data types in binary to a stream.
System.Xml.XmlTextWriter Provides a fast, non-cached, forward-only way of generating XML streams or files.

Here are links for sample examples of how the readers and writers abstract reading and writing data. 

No comments:

Post a Comment