17

Streams and files

A file is an ordered sequence of bytes explicitly having a start and an end, characterized by storage. A stream is characterized by realtime data transfer of unbounded duration on a unidirectional channel – that is, with no upstream channel for flow control, acknowledgement, or retransmission request. Table 17.1 provides a general summary of the characteristics of files and streams.

Table 17.1. Files and streams are compared.

A file … A stream …
… has predefined beginning and end … has indeterminate beginning and end
… usually involves storage media … usually involves an external data interconnect
… permits “random access” to data … involves sequential data access, typically starting midstream
… has structure imposed ...

Get Digital Video and HD, 2nd Edition 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.