组成流链输入数据
FileOutputStream fouts=new FileOutputstream("mydata.dat");
BufferedOutputStream bOuts=new BufferedOutputStream(fouts);
DataOutputStream dOuts=new DataOutputStream(bOuts);
组成流链输出数据
FileInputStream fins=new FileOutputstream("mydata.dat");
BufferedInputStream bIns=new BufferedInputStream(fins);
DataInputStream dIns=new DataInputStream(bIns);
这是用来访问二进制的文件。DataInputStream与DataOutputStream要对应起来。
FileReader fr=new FileReader("mydata.txt")
BufferedReader bf=new BufferedReader(fr)
字符输入流,读字符unicode类型的文本文件,BufferedReader类有readLine()方法。
FileWriter fw=new FileWriter("exception.txt");
BufferedWriter bw=new BufferedWriter(fw);
PrintWriter pw=new PrintWriter(bw);
字符输出流
个人小结与大家共享。