Stream definition

Viewed 15599

I'm reading on Java I/O streams and I'm confused on the correct definition associated with them.

  • Some say that a stream is a sort of conveyor belt in which data are transmitted...
  • other say that a stream is a flow or a sequence of a data...
  • other say that a stream is a connection to an input or an output source...

So what's the correct definition?

6 Answers

In my viewpoint stream is actually a conveyor belt as you mention in the first point. Actually there are two types of stream, input, and output. An input stream is used to read the data from the input device like keywords and write that data to the files and output stream is used to read data from the disks, files, etc and write that data to the output device like console, monitor, etc.

In a simple way, it is the bridge that helps to transport things from one point to another.

Related