In text file we use below to check EOF.

VB Code:
  1. InputStreamReader os = new InputStreamReader(.........);
  2. int ch;
  3. while((ch=os.read()) != -1){ //Check whether EOF or not
  4.   //Output Something
  5. }

But in binary file i don't how to check EOF
VB Code:
  1. DataInputStream os = new DataInputStream(.........);
  2. System.out.println(os.readInt());
  3. System.out.println(os.readFloat());

I don't how used loop to print content of file until EOF. Please tell me.