Recall that binary files are those whose bytes might hold any possible pattern. These patterns are used to represent all the types of data that a computer can deal with. Binary files store data that have 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.
You have found an old hard drive in a box of junk behind a water cooler. On it, you find a mysterious file. It looks like it might be a file 32-bit integers. You don't know what program produced it. Can you write a Java program to read it?