Lecture overview -- Keyboard shortcut: 'u'  Previous page: Subclasses of class Stream -- Keyboard shortcut: 'p'  Next page: The using control structure -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Input and Output Classes - slide 6 : 40

Example: Filestreams

Class FileStream is a non-abstract subclass of class Stream

We show the simplest possible write and read programs using class FileStream

write-prog.cs
A program that writes bytes corresponding to 'O' 'O' 'P' to a file stream.
myFile.bin
The contents of myFile.bin - interpreted as simple ASCII text - after executing the write program.
read-prog.cs
A program that reads the written file.
output
Console output from the read program.
Class FileStream offers binary input and output