import java.io.*; public class test13_6 { public static void main(String []args) throws Exception { FileOutputStream output=null; FileInputStream input=null; BufferedOutputStream buffout=null; BufferedInputStream buffin=null; byte[]bytes=new byte[1024];//放一个空数组 args[0]="C:\Users\ASUS\Desktop\"+args[0];//只有在命令行输入,表示输入 args[1]="C:\Users\ASUS\Desktop\"+args[1];//命令行,表示输出 input=new FileInputStream(args[0]); output=new FileOutputStream(args[1]); buffin=new BufferedInputStream(input); buffout=new BufferedOutputStream(output); int len ; while((len= input.read(b)) != -1) { buffout.write(bytes,0,len); } buffin.close(); buffout.close(); input.close(); output.close(); } }
Buffered缓冲还是没感觉这个流多快,就是统一进磁盘,加快速度,或许吧