created: 06/20/00; revised: 07/08/02

CHAPTER 86 — Reading Binary Files

Recall that binary files are those whose bytes might hold any possible pattern. Binary files store data that has not been translated into character form. Of course, a binary file can store character data mixed in with its other data types. A file that exclusively stores character data is called a text file.

The subclasses of InputStream are designed for byte-oriented input from any source. Many types of data sources of data can serve as an InputStream. However, in this chapter, the source will be a file on the hard disk.

Chapter Topics:

QUESTION 1:

While examining a hard drive that you found in a junk box you find a mysterious file. It looks like it might be a file of 32-bit integers. Can you write a Java program to read it?