import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class MainClass {
public static void main(String[] argv) {
try {
// Construct the chain
FileInputStream fis = new FileInputStream("fname");
DataInputStream dis = new DataInputStream(fis);
// Read
double d = dis.readDouble();
int i = dis.readInt();
String s = dis.readUTF();
// Close the chain
dis.close(); // Close dis first, because it
fis.close(); // was created last
} catch (IOException e) {
}
}
}
|