How PDF file created / read? (Explained in class)
How image file transfers to others on WhatsApp? (explained in class)
I/O, short for Input/Output refers to the communication between your computer/program and the outside world (which could be a user, a file system, a network, or another system). Input is the data that is sent to the system, while output is the data that the system produces.
Stream
A stream is a sequence of data. It can be visualized as a continuous flow of data.
A program uses an input stream to read data from a source, one item at a time.
A program uses an output stream to write data to a destination, one item at time.
Java uses the concept of a stream to make I/O operation fast. The java.io
package contains all the classes required for input and output operations.
I/O Stream
I/O (Input/Output) streams are fundamental concepts in programming that enable data transfer between different sources and destinations such as files, network connections, memory buffers, etc. An I/O Stream represents an input source or an output destination. A stream can represent many different kinds of sources and destinations, including disk files, devices, other programs, and memory arrays. Most modern programming languages, including Java, C++, and Python, provide built-in support for handling I/O streams.