O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Streams

When using streams, it is best to think of the different types of streams in an abstract sense. They are all a stream or a block of data that you can write to or read from. The medium that holds this data differentiates the different stream classes. Therefore, a FileStream hosts a block of data in a file; a MemoryStream hosts a block of data in memory. The methods by which you read from and write to a stream are the same. The following examples will use a FileStream; however, using a MemoryStream or NetworkStream will be, for the most part, identical.

Whereas the streaming classes encapsulate the block of data, one requires readers and writers to read from a stream and to write to a stream, respectively. For a text-based stream, these ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required