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缓冲还是没感觉这个流多快,就是统一进磁盘,加快速度,或许吧

内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/otakus/p/12206255.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!