Answer the question
In order to leave comments, you need to log in
What is Stream in terms of PL and in terms of approach/method/paradigm?
I know that the concept of data streams (streams or streams) is closely related to the Linux OS. I would like to know exactly what streams are as an approach / method / abstraction from the point of view of computer science, regardless of programming languages. Wikipedia gives a vague definition https://ru.wikipedia.org/wiki/Data_stream
Also I want to know what does stream mean from the point of view of specific programming languages, for example C ++, Java, Javascript?
Stackoverflow also gave a vague definition https://stackoverflow.com/a/12145419/7455192 :
"The term stream is an abstraction of a construct that allows you to send or receive an unknown number of bytes."
"A data stream is an abstraction that allows you to send and receive an unknown number of bytes."
Answer the question
In order to leave comments, you need to log in
If you have already worked with files, then you probably know that you can find out the size of a file and read information from it sequentially. If you wish, you can "scroll" to the right place and read starting from this place.
In the stream, everything is almost the same, but:
1. the size is unknown
2. it is impossible to rewind.
You can only read what someone else wrote to this stream
, or maybe the data came over the network. And you can read everything that is there from the buffer, and after a while something new will appear there. So it goes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question