import java.io.*;

public class DataInputStreamTest {
	public static void main(String args[]) throws IOException {
		FileInputStream fin=null;
		DataInputStream din=null;

		try{
			fin = new FileInputStream("data.txt");
			din = new DataInputStream(fin);
		}catch(FileNotFoundException e){
			e.printStackTrace();
		}

		try{
			double d=din.readDouble();
			int i = din.readInt();
			String s= din.readUTF();
			System.out.println(d+"\t"+i+"\t"+s);
		}catch(IOException e){
			e.printStackTrace();
		}finally{
			din.close();
			fin.close();//关闭顺序与建立顺序正好相反。
		}
	}
}
