I/O in the twenty-first century – knowing streams

Many of the I/O related activities handle streams of data. A stream is a sequence of data elements made available over time. According to Wikipedia:

A stream can be thought of as a conveyor belt that allows items to be processed one at a time rather than in large batches.

At the lowest level, all the streams are bytes, but using a high-level interface could obviously help the programmer to handle his data. This is the reason why a stream object usually has methods such as read, seek, write, and many more, just to make the handling of byte stream a bit simpler.

In this recipe, we'll see some streams utilization examples.

Getting ready

In the good old Pascal days, there was a set of functions to handle ...

Get Delphi Cookbook 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.