Java Stream

A stream is an abstract concept that means an ordered sequence of data. It refers to data that flows resources from one place to another. This data is transferred in units such as bit, char, and byte.

There are two types of streams: byte streams and character streams. Byte streams are streams for reading and writing 8-bit bytes, and they use subclasses that inherit from the InputStream and OutputStream classes. Character streams are streams for reading and writing 16-bit characters or strings, and they use subclasses that inherit from the Reader and Writer classes for input and output.