性格決定命運,氣度影響格局
          posts - 20, comments - 18, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          一個實現了文件拷貝的小程序

          Posted on 2007-07-31 14:16 尚愛軍 閱讀(222) 評論(0)  編輯  收藏

          import java.io.*;

          public class FileCopy {
           public static void main(String[] args) {
            int  temp = 0;
            
            try {
             
             BufferedInputStream bis = new BufferedInputStream(new FileInputStream("d:\\111042010449.wmv"));
             BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("d:\\1110.wmv"));
             while((temp=bis.read()) !=-1) {
              bos.write(temp);
             }
             bis.close();
             bos.flush();
             bos.close();
            }catch (IOException e) {
             e.printStackTrace();
             System.out.println("文件讀取錯誤!!!");
            }
            System.out.println("文件拷貝成功!!!");
           }
          }


          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 桑日县| 襄樊市| 南陵县| 东丽区| 图木舒克市| 天台县| 越西县| 甘孜| 竹溪县| 凯里市| 囊谦县| 湟源县| 云龙县| 江孜县| 高雄县| 尼勒克县| 绥芬河市| 昆山市| 宜兰市| 迁安市| 长顺县| 禹州市| 大石桥市| 横山县| 新津县| 扎赉特旗| 曲阜市| 汤阴县| 泽普县| 汝南县| 正定县| 六枝特区| 大庆市| 渝中区| 福州市| 云梦县| 革吉县| 阿勒泰市| 台北县| 新乐市| 定边县|