The streams are designed for handling and processing data streams:
I/O Streams: data flows in from or out to outer source
Stream API: data flows through data processing steps
These two types are very distinct, and works differently.
FIGURE OF THE MAIN STREAM FAMILIES:
I/O streams can read or write data via unified ways from file, network, memory, other software or an object serialization.
The aim is to have
flexibility (any data source is manageable)
extendability (easily added new streams)
effectibility (buffered reading and writing)
platform independency (managing character coding)
FIGURE OF I/O STREAMS HIEARCHY:
The byte streams are work with raw bytes. Typical usage:
binary files (image, sound, PDF)
network data flow
serialization of an object
The character streams are work with characters with automated character coding management. Typical usage:
text files
configuration files
logs
A combination of BufferedReader and InputStreamReader, and BufferedWriter and OutputStreamWriter are commonly used. These solutions are called decorator patterns.
EXAMPLE FOR DECORATOR PATTERN:
Elements of the Stream API helps to create, filter, process, transform, sort and convert data sets like elements of the Java Collections Framework (JCF).
FIGURE OF STREAM API HIEARCHY: