ReadBinaryFile.java - import java.io public class...

This preview shows page 1 out of 1 page.

import java.io.*; public class ReadBinaryFile { //This program opens a binary file, reads, and displays the contents. public static void main(String[] args) throws IOException { int number; //A number read from the file boolean endofFile = false; //EOF flag //Create the binary file input objects FileInputStream fstream = new FileInputStream("Numbers.dat"); DataInputStream inputFile = new DataInputStream(fstream);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture