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.
|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 ...|