Input and Output Classes
- slide 9 : 40
Readers and Writers in C#
On top of the stream classes, C# offers a number of specific
adapter classes
that support reading and writing at a
higher level of abstraction
Input
Output
Text
TextReader
StreamReader
StringReader
TextWriter
StreamWriter
StringWriter
Binary
BinaryReader
BinaryWriter
Higher level of abstraction
IO of chars and text strings - not just raw bytes
IO of values in simple types
The
Type
Reader
and
Type
Writer
classes are not subclasses of the stream classes
They are typically built on - and
delegates to
- a
Stream
object
A Reader or Writer classes
has
a stream - it
is not
a stream
Reader and Writer classes serve as
Stream adapters