Streams

Serialization is the ability to read and write an arbitrary object graph (reading is sometimes called deserialization). Before we can talk about serializing objects, we need to talk about where they're going serialized to.

Whenever an object is serialized, it must go somewhere. It may go into memory, a file, a database record, or a socket. Generally, where the data is actually written doesn't matter to the object itself. It needs to store the same data regardless of where it goes. All the object generally cares about is that bytes can be written and read, and sometimes we'd like to skip around among the bytes. To satisfy these desires, .NET provides the abstract base class Stream from the System.IO namespace:

 MustInherit Class Stream ...

Get Windows Forms Programming in 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.