Hello, I have been working on this all day. I can't get Relative paths to work. I have created the class.dat file and I can't get java to recognize it. I am using Eclipse as an IDE. Was wondering if I could get Eclipse to recognize it. I tried with a .txt file as well and couldn't get that to work.
import java.io.*; public class ReadBytes { public static void main(String[] args) { try { FileInputStream file = new FileInputStream("class.dat"); boolean eof = false; int count = 0; while(!eof) { int input = file.read(); System.out.print(input + " "); if (input == -1) eof = true; else count++; } file.close(); System.out.println("\nBytes read: " + count); } catch (IOException e) { System.out.println("Error -- " + e.toString()); } } }