陌上花开

遇高山,我御风而翔,逢江河,我凌波微波

   :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::

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 阅读(726) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
我要啦免费统计