Objective elements
There is no standard for representing stream objects.
About some objective elements:
But as you explained it, the streamstream is an abstraction of a flow of dataflow of data. But what is not well shown is that this abstraction also hides the origin and the size of the stream:
- it can be a file stored on the file system, and that has a finished size;
- it can be a file object representing itself a stream of incoming characters typed on the console, with no end until you shut down-down the computer;
- it can be data coming from a network connection over the internet that streams a potentially infinite set of data (e.g. temperature measurements in you house, mesaurementsmeasurements of factory sensors, etc...)
For all these reasons,The potentially infinite size of the data is an important element to get the concept of a stream and more generally stream-based architectures right. This is why you should not show the stream as a boxed (finished) content, but suggest the uncertainty and possible endlessabout the source of the flow in some way.
Subjective remarks
Subjective remarks
Your first representation of a pipe conveys well the idea. MaybeThis kind of representation is used in several books dedicated to stream based architetures (e.g. Streaming Architecture by Ted Dunning & Ellen Friedman).
But maybe do not connect it to a a boxed file, but rather some cloud with a question mark? or at least show some tap on the side of the file to suggest that it's just a possible connection.
Another alternative is to show the stream like your pipe, but with an arrow on one side. This clarifies that there's a direction for reading and another direction for writing; and it allows to link the stream concept with conventions of data-flow diagramming, which uses (thin) arrows to connect processes. Your large arrow would then be understood as a zoom on such an arrow. (This convention was for example used in the book Streaming Data: Understanding the real-time pipeline by Andrew Psaltis).
But I give these subjective elements only as additional info on the top of the objective part, since opinions are a matter of taste, and there's no best way to do it.