Section 17.4.3 Check Point Questions5 questions 

17.4.3.1
Suppose a file contains an unspecified number of double values that were written to the file using the writeDouble method using a DataOutputStream, how do you write a program to read all these values? How do you detect the end of a file?
17.4.3.2
How do you check the end of a file in an input stream (FileInputStream, DataInputStream)?
17.4.3.3
Suppose you run the following program on Windows using the default ASCII encoding after the program is finished, how many bytes are there in the file t.txt? Show the contents of each byte.
public class Test {
  public static void main(String[] args) 
      throws java.io.IOException {
    try (java.io.PrintWriter output = 
        new java.io.PrintWriter("t.txt"); ) {
      output.printf("%s", "1234");
      output.printf("%s", "5678");
      output.close();
    }
  }
}
17.4.3.4
After the following program is finished, how many bytes are there in the file t.dat? Show the contents of each byte.
import java.io.*;

public class Test {
  public static void main(String[] args) throws IOException {
    try (DataOutputStream output = new DataOutputStream(
        new FileOutputStream("t.dat")); ) {
      output.writeInt(1234);
      output.writeInt(5678);
      output.close();
    }
  }
}
17.4.3.5
For each of the following statements on a DataOutputStream output, how many bytes are sent to the output?
output.writeChar('A');
output.writeChars("BC");
output.writeUTF("DEF");