日期:2014-05-20 浏览次数:20596 次
package javaIO;
import java.io.*;
public class IOBug {
/**
* 功能描述: <br>
* 〈功能详细描述〉
*
* @param args
* @see [相关类/方法](可选)
* @since [产品/模块版本](可选)
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream("data3.txt")));
out.writeDouble(3.1415926);
out.writeBytes("that was the value of pi");
out.writeBytes("this is pi/2 "+"\n");
out.writeDouble(3.1415926);
out.close();
DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream("data3.txt")));
BufferedReader inbr = new BufferedReader(new InputStreamReader(in));
System.out.println(in.readDouble());
System.out.println(inbr.readLine());
System.out.println(inbr.readLine()); ///此行
System.out.println(in.readDouble());
}
}