数据流,专门用来做基本数据类型的读写
public class Test05 {
public static void main(String[] args) {
try {
Test05.testInputStream();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void testOutputStream() throws Exception{
DataOutputStream out=new DataOutputStream(new FileOutputStream("E:\\java\\idea\\javaBasics\\javaSE\\基础语法\\src\\ioStream\\Buffered\\tt9.txt"));
out.writeInt(100);
out.flush();
out.close();
}
public static void testInputStream() throws Exception{
DataInputStream in = new DataInputStream(new FileInputStream("E:\\java\\idea\\javaBasics\\javaSE\\基础语法\\src\\ioStream\\Buffered\\tt9.txt"));
System.out.println(in.readInt());
in.close();
}
}