zoukankan      html  css  js  c++  java
  • javeee 字节Buffered

    package Zy;
    
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    
    public class Zy04 {
                //4.用缓冲字节流完成eclipse.zip的复制
        public static void main(String[] args) throws IOException {
            long time1=System.currentTimeMillis();
            FileInputStream fis=new FileInputStream("e:\eclipse.zip");
            BufferedInputStream bf=new BufferedInputStream(fis);
            FileOutputStream fos=new FileOutputStream("e:\java\123\eclipse.zip");
            BufferedOutputStream bd=new BufferedOutputStream(fos);
            byte[] bytes=new byte[1024];
            int len=0;
            while((len=bf.read(bytes))!=-1){
                bd.write(bytes,0,len);
                bd.flush();
            }
                bd.close();
                long time2=System.currentTimeMillis();
                System.out.println((time2-time1)/1000);
        }    
    }
  • 相关阅读:
    properties 插件安装
    FineReport 安装教程
    Red/Black Tree 演示
    java 日期转化
    Tomcat使用Log4j按天生成日志 亲测可行
    服务器初始化
    ubuntu-rc.local
    django-views
    https tcp ssl
    svn
  • 原文地址:https://www.cnblogs.com/hankai2735/p/9224801.html
Copyright © 2011-2022 走看看