Files (file) and stream (stream) are both distinct and connected. A file is an ordered collection of data that is permanently stored on various media (removable disks, hard disks, CDs, and so on). It is a basic object for data read and write operations. Typically, files are organized in a tree directory, each with a file name, path to the file, creation time, access rights, and so on.
Conceptually, a stream is very similar to a separate disk file, and it is also a basic object for data-reading operations. Stream provides us with continuous byte-throttling storage space. Although the actual location of the data storage can be discontinuous, or even distributed on multiple disks, but we see the encapsulation of the data structure, is a continuous flow of the abstract structure of the byte stream. This and a file can also be distributed across multiple sectors on the disk.
In addition to file streams that are directly related to disk files, there are several types of streams, which can be distributed across the network, in memory, or in tape.