created: 06/20/00

CHAPTER 86 --- Reading Binary Files

Recall that binary files are those with bytes that can hold any possible pattern. Binary files store primitive data that has not been translated into character form. Of course, binary files can also store character data. A file that exclusively stores character data is called a text file.

The subclasses of InputStream are designed for byte-oriented input. These streams are used for input of primitive data from several sources, including binary files.

Chapter Topics:

  • Reading binary files.
  • Advantages of binary files.
  • DataInputSteam
  • FileInputSteam
  • BufferedInputSteam
  • Reading and writing integers.
  • Reading and writing single bytes.

QUESTION 1:

While looking at some files from Los Alamos you find a file of integers written by a Java program. Will your Java program be able to read it?

Click Here after you have answered the question