1、1()(1)(21.03_IO().avi)FileReader fr = new FileReader(aaa.txt);FileWriter fw = new FileWriter(bbb.txt);char ch = 0;while(ch = fr.read() != -1) fw.write(ch);fr.close();fw.close();(2)(21.06_IO().avi)FileReader fr = new FileReader(aaa.txt);FileWriter fw = new FileWriter(bbb.txt);int len= 0;char arr = ne
2、w char1024*8;while(len = fr.read(arr) != -1) fw.write(arr, 0, len);fr.close();fw.close();()(1)(21.07_IO().avi)BufferedReader br = new BufferedReader(new FileReader(aaa.txt);BufferedWriter bw = new BufferedWriter(new FileWriter(bbb.txt);int ch= 0;while(ch = br.read() != -1) bw.write(ch);br.close();bw
3、.close(); (2)()BufferedReader br = new BufferedReader(new FileReader(aaa.txt);BufferedWriter bw = new BufferedWriter(new FileWriter(bbb.txt);int len= 0;char arr = new char1024*8;while(len = br.read(arr) != -1) bw.write(arr, 0, len);br.close();bw.close(); 2!(1),(a)longsum(𣬴)(b)ScannernextLine
4、String(c)File fString(d)getLength(File file),f(e)listFiles(),洢File(f),(g),length()sumsum(h),getLength()FilegetLength()(i)(2),(a)ScannernextLineString(b)File fString(c)deleteFile(File file),f(d)listFiles(),洢File(e),(f),delete()(g),deleteFile()FiledeleteFile()(h)deletefile(3),()(a)longsum(𣬴)(b
5、)ScannernextLineString(c)File srcf()String(d)nextLineString(e)File destf()String(d)copyFile(File srcDir,File destDir),f(e)listFiles()srcfile,洢File(f),File file(h)file,destDirdestDirfiledestFile,copyFile(),FilecopyFile()(g)file,destDirdestFilefiledestFile,(岽費)(i)(4), :aaa,bbb.txt,ccc.txt,ddd.txt,eee,eeefff.txtggg.txt,aaabbb.txtccc.txtddd.txteeefff.txtggg.txt(a)ScannernextLineString(b)File fString(c)showFile(File fileint leave ),f,leave0(d)listFiles(),洢File(e)1:,(f)2:for0 ( int i=0;ileave;i+)(g)22( s.o.print(t) ln)(h)21()(i)1File,leave+=1copyFile(),FileleavecopyFile()(j)