An InputStream
handles byte data.
InputStream
is an abstract class from which all
byte-oriented input streams are derived.
Its descendant classes are used for general-purpose input
(non-character input).
These streams
deliver data to a program in groups of 8-bit bytes.
The bytes can be grouped into the size necessary for
the type of data.
Unlike Reader
s and Writers
s,
no transformation of bytes is performed.
If you input data from a disk file using a decendant of InputStream
what is on the disk is exactly what you get.
This is what you want for many types of data: audio, image, database, machine code....
For example,
if a disk file contains 32-bit int
data,
the program can read exactly those bits in 4-byte groups.
We will be mostly concerned with DataInputStream
and FileInputStream
.
(Review: ) What type of data does an OutputStream
handle?