zoukankan      html  css  js  c++  java
  • 第四次java作业

    /**  

    * @param args

    */

       public static void copy(File a,File b){  

                try {         FileInputStream fis = new FileInputStream("a.mp3");      

                FileOutputStream fos = new FileOutputStream("temp.mp3");      

                byte[] buf = new byte[1024];     

                int len;  

                int read = fis.read();    

                while((len = fis.read(buf))!=-1){       

                       fos.write(buf, 0, len);     

        }        

           fis.close();  

           fos.close();    

        } catch (IOException e) {   

        // TODO Auto-generated catch block      

                e.printStackTrace();  

       }

       }

               public static void main(String[] args) {  

       // TODO Auto-generated method stub

          File a = new File("");   

          File b = new File("");  

          long start,end;    

          start = System.currentTimeMillis();   

          copy(a,b);    

          end = System.currentTimeMillis();

          System.out.println("复制所用时间:" + (end - start) + "ms"); }

    }

  • 相关阅读:
    [bzoj1251]序列终结者
    Codeforces #Round 406(Div.2)
    [3.23校内训练赛]
    [APIO2009]
    [APIO2016]
    [bzoj1901]动态区间k大
    [9018/1904]火星商店
    [bzoj3673/3674可持久化并查集加强版]
    [bzoj1297][SCOI2009]迷路
    [bzoj1218][HNOI2003]激光炸弹
  • 原文地址:https://www.cnblogs.com/lkh960317/p/5375038.html
Copyright © 2011-2022 走看看