import java.io.DataInputStream;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
public class MainClass {
public static void main(String[] args) throws Exception {
DataInputStream din = null;
try {
FileInputStream fin = new FileInputStream("myfile.dat");
din = new DataInputStream(fin);
while (true) {
int theNumber = din.readInt();
System.out.println(theNumber);
}
} catch (EOFException ex) {
din.close();
} catch (IOException ex) {
System.err.println(ex);
}
}
}
|