Chapter 8. Object In, Object Out

I/O in the .NET framework centers on the stream. Think of a stream as a flow of data. The process of using a stream can be likened to two people standing at opposite ends of a river. The person upstream puts a message in a bottle and drops it in. Downstream, the other person waits with a net to pull the bottle out and get the message. The only difference between a .NET stream and this allegorical river is that the stream flows both ways.

The stream is a useful abstraction that makes it possible to read and write data to and from a variety of sources generically. For the most part, the operations for reading bytes from a file, from memory, or from a network socket are identical.

Get Object-Oriented Programming with Visual Basic .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.