国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

最快復制文件方法() out.transferFrom(in, 0, in.size());

2019-11-14 21:39:04
字體:
來源:轉載
供稿:網友
最快復制文件方法() out.transferFrom(in, 0, in.size());
 1 package test; 2 import java.io.*; 3 import java.nio.channels.FileChannel; 4 public class Test31 5 { 6     public static void main(String[] args) throws Exception 7     { 8         String dir = "E:/"; 9         // 調用方法10         copyFile(dir + "DV-1676.mp4", dir + "DV-1676_copy.mp4");11     }12     public static boolean copyFile(String readfile, String writefile) throws Exception13     {14         FileInputStream fis = null;15         FileOutputStream fos = null;16         // 定義兩個直連的文件管道17         FileChannel in = null, out = null;18         fis = new FileInputStream(readfile);19         fos = new FileOutputStream(writefile);20         in = fis.getChannel();21         out = fos.getChannel();22         // 直接讓流流向要拷貝的文件23         out.transferFrom(in, 0, in.size());24         in.close();25         out.close();26         fis.close();27         fos.close();28         return true;29     }30 }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 聂拉木县| 遂川县| 温宿县| 阳山县| 花莲市| 临潭县| 武强县| 伊春市| 泰来县| 稷山县| 富源县| 平果县| 华亭县| 临漳县| 新田县| 乐陵市| 怀远县| 东兰县| 桐城市| 轮台县| 兴义市| 百色市| 嘉兴市| 瓦房店市| 墨玉县| 德州市| 张掖市| 日照市| 剑川县| 榆林市| 遵义市| 余江县| 防城港市| 尚义县| 兴义市| 曲阳县| 嫩江县| 绥芬河市| 东至县| 丘北县| 特克斯县|