Chinaunix首页 | 论坛 | 博客
  • 博客访问: 846035
  • 博文数量: 221
  • 博客积分: 10033
  • 博客等级: 上将
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-06 22:00
文章分类

全部博文(221)

文章存档

2010年(8)

2009年(1)

2008年(69)

2007年(63)

2006年(80)

我的朋友

分类: Java

2007-11-05 20:26:48

package cn.edu.nankai.io;
import java.io.*;
public class Duanlei {
public static void main(String [] args) throws Exception{
    FileInputStream file=new FileInputStream("c:\\1.txt");
    BufferedInputStream in=new BufferedInputStream(file);
    byte buf[]=new byte[8192];
    BufferedOutputStream out=new BufferedOutputStream(new FileOutputStream("c:\\3.txt"));
    int len=0;
    int bytesRead=0;
    while((bytesRead = in.read(buf, 0, 8192)) != -1)
    {
    out.write(buf,0,bytesRead);        
    System.out.println(bytesRead);
    }
      in.close();
out.close();
    
   
}
}
 
阅读(928) | 评论(0) | 转发(0) |
0

上一篇:java io学习起步

下一篇:my girlfriend give me

给主人留下些什么吧!~~