JAVA程序设计题

[复制链接]
查看11 | 回复3 | 2009-6-9 08:28:45 | 显示全部楼层 |阅读模式
读硬盘中的两个文件,合并写到另一个文件;就是这个小程序。能不能做好了,发个我呢?
我的邮箱地址是[email protected]

回复

使用道具 举报

千问 | 2009-6-9 08:28:45 | 显示全部楼层
//: FC.java//任何内容都可合并,不限文本文件import java.io.*;public class FC { //将f1,f2,中的内容合并写入f3中 static void test(String f1,String f2,String f3)throws Exception{byte[] buffer = new byte[1024*8];int read;BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(f3));BufferedInputStream bin = new B...
回复

使用道具 举报

千问 | 2009-6-9 08:28:45 | 显示全部楼层
楼上的很对,补充一条 bout.write(buffer,0,read);之后最后加一句bufferedWriter.newLine(); // 换行...
回复

使用道具 举报

千问 | 2009-6-9 08:28:45 | 显示全部楼层
网上好多,你查一下。合并文件,就是合并COPY...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行