go to previous page   go to home page   go to next page

Answer:

An InputStream handles byte data.


InputStream

Java input hierarchy

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 Readers and Writerss, 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.


QUESTION 10:

(Review: ) What type of data does an OutputStream handle?


go to previous page   go to home page   go to next page