陌上花開

          遇高山,我御風(fēng)而翔,逢江河,我凌波微波

             :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::

          mport java.io.File;
          import java.io.FileInputStream;
          import java.io.FileOutputStream;
          import java.nio.MappedByteBuffer;
          import java.nio.channels.FileChannel;


          public class MbbDemo {
           
           public static  void main(String []args)throws Exception
           {
            File file=new File("d://a.txt");
            FileInputStream fis=new FileInputStream(file);
               FileOutputStream fos=new FileOutputStream("d://acopy.txt");
               FileChannel fChannel=fis.getChannel();
               FileChannel out=fos.getChannel();
               MappedByteBuffer mbb=fChannel.map(FileChannel.MapMode.READ_ONLY, 0,file.length());
               out.write(mbb);
               if(fis!=null)fis.close();
               if(fos!=null)fos.close();
            
            
           }

          }

          posted on 2012-05-25 14:11 askzs 閱讀(750) 評論(0)  編輯  收藏

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


          網(wǎng)站導(dǎo)航:
           
          我要啦免费统计
          主站蜘蛛池模板: 新巴尔虎右旗| 龙陵县| 南漳县| 正定县| 屏南县| 安多县| 集安市| 望江县| 两当县| 响水县| 孝感市| 郁南县| 吉木萨尔县| 阜阳市| 神农架林区| 南和县| 镇江市| 大城县| 六安市| 藁城市| 鹤庆县| 子洲县| 修水县| 兴安盟| 阳朔县| 潜山县| 门源| 海口市| 松江区| 邛崃市| 鸡东县| 东方市| 隆尧县| 都昌县| 阿坝县| 广河县| 刚察县| 镇沅| 斗六市| 成安县| 深州市|