package demo16;

import java.io.*;

public class Demo03CopyFor {
    public static void main(String[] args) throws IOException {
        long e = System.currentTimeMillis();
        FileInputStream fis = new FileInputStream("D:\\C0103.MP4");
        BufferedInputStream bis = new BufferedInputStream(fis);

        FileOutputStream fos = new FileOutputStream("E:\\C0103.MP4");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        byte[] bytes = new byte[10240];
        int len = 0;
        while ((len = bis.read(bytes))!= -1){
            bos.write(bytes);
        }

        bis.close();
        bos.close();
        long s = System.currentTimeMillis();
        System.out.println("系统总耗时:"+(s-e)+"毫秒~");
    }
}

系统总耗时:40毫秒~

最后修改:2021 年 09 月 26 日
如果觉得我的文章对你有用,请随意赞赏