Justin.Lu----Position

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  4 随笔 :: 6 文章 :: 3 评论 :: 0 Trackbacks

File Copy

// Copies src file to dst file.
// If the dst file does not exist, it is created
void copy(File src, File dst) throws IOException
{
 InputStream 
in = new FileInputStream(src);
 OutputStream 
out = new FileOutputStream(dst);
 
 
// Transfer bytes from in to out
 byte[] buf = new byte[1024];
 
int len;
 
while ((len = in.read(buf)) > 0)
 
{
     
out.write(buf, 0, len);
 }

 
in.close();
 
out.close();
}
posted on 2005-08-18 20:57 Justin 阅读(2071) 评论(6)  编辑 收藏 引用

评论

# re: Java File Copy 2010-03-21 10:56 RaquelCRAFT24
If you want to buy real estate, you will have to get the <a href="http://lowest-rate-loans.com/topics/credit-loans">credit loans</a>. Furthermore, my sister always uses a short term loan, which supposes to be the most rapid.   回复  更多评论
  

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