Lecture overview -- Keyboard shortcut: 'u'  Previous page: More FileStream Examples -- Keyboard shortcut: 'p'  Next page: The class Encoding -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 9 : 40
Object-oriented Programming in C#
Input and Output Classes
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

InputOutput
TextTextReader
    StreamReader
    StringReader
TextWriter
    StreamWriter
    StringWriter
BinaryBinaryReaderBinaryWriter

An overview of Reader and Writer classes

  • Higher level of abstraction

    • IO of chars and text strings - not just raw bytes

    • IO of values in simple types

  • The TypeReader and TypeWriter 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