public class Test{

public static void main(String[] args) throws IOException{
FileInputStream in = null;
BufferedInputStream bis =null;
FileOutputStream out =null;
BufferedOutputStream bos =null;
try {
in=new FileInputStream("c:/123/666.doc");
bis=new BufferedInputStream(in);

out=new FileOutputStream("c:/123/999.doc");
bos = new BufferedOutputStream(out);
int len =0;
byte[] buffer = new byte[1024];
while((len=bis.read(buffer))!=-1){
bos.write(buffer, 0, len);
// bos.write(buffer);
}
}
catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}finally{

bos.flush();    //清空缓存写入数据
bos.close();   //一定要关闭流否则文档打开不了
out.close();
bis.close();
in.close();
}

}

最新文章

  1. 在 Delphi 中判断一个字符是中文的方法
  2. Windows 10 安装双系统 CentOS 7
  3. App开发三种模式
  4. CSS应用心得
  5. hdu 1054 最小点覆盖
  6. HDU1002 -A + B Problem II(大数a+b)
  7. 深入理解计算机系统第二版习题解答CSAPP 2.3
  8. java获取天气信息
  9. 何时可以开启透明数据加密(TDE)?
  10. JavaWEB HTTP请求中POST与GET的区别
  11. Elasticsearch常用插件(三)
  12. swig官方go Examples 源码勘误
  13. tomcat环境配置 Linux 与 Windows
  14. debian The type initializer for 'System.Drawing.KnownColors' threw an exception
  15. 小程序git发布
  16. LVS搭建负载均衡(二)DR模型
  17. git初始化本地项目并推送到git服务器
  18. python 美化打印json数据
  19. Django 前台通过json 取出后台数据
  20. 【TP3.2.X】linux环境下TP3.2.X的各个目录权限

热门文章

  1. iOS开发XCODE5 SVN配置 使用办法
  2. 添加Sql作业,新建步骤出现:从IClassFactory为CLSID为{AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2}的COM组件创建实例失败,原因是出现以下错误:c001f011。的解决方法
  3. poj1080 dp
  4. 使用开源工具MonoDevelop开发GTK#图形界面
  5. C#导入EXCEL数据
  6. task2
  7. Bochs使用说明
  8. 实现:TextView自由复制功能
  9. ERP仓库管理系统(九)
  10. SQL技巧