合并两个文件
来源:互联网 发布:apache 配置php报错 编辑:程序博客网 时间:2024/05/18 02:07
原文:合并两个文件
源代码下载地址:http://www.zuidaima.com/share/1550463699438592.htm
使用java合并两个已存在的文件的内容到一个新的文件去
import java.io.*;package com.zuidaima.file.util;/***@author www.zuidaima.com**/class combinefile{public static void main(String[] args) throws IOException {BufferedReader br = new BufferedReader(new InputStreamReader(System.in));//get the path of fileSystem.out.print("please enter the path of first file");String filebr1=br.readLine();System.out.print("please enter the path of second file");String filebr2=br.readLine();System.out.print("please input the path of combine file");String filebr3=br.readLine();//transform the real file into object;File file1 = new File(filebr1);File file2 = new File(filebr2);File file3 = new File(filebr3);//transform file1 and file2 object into inputstreamFileInputStream fis1 = new FileInputStream(file1);FileInputStream fis2 = new FileInputStream(file2);//transform file3 object into outputstreamFileOutputStream fos = new FileOutputStream(file3);//combine two stream into one streamInputStream is = new SequenceInputStream(fis1,fis2);int c;while((c=is.read())!=-1){fos.write((char)c);}System.out.println("OK");is.close();fos.close();}}
1 0
- python两个文件合并
- 合并两个文件
- 合并两个HEX文件
- 合并两个S19文件
- 合并两个文件
- 两个文件的合并
- awk 合并两个文件
- java 两个文件合并程序
- 如何将两个文件合并?
- 合并两个文件中的列
- 两个文件合并成一个二进制文件,再将这两个文件还原
- 怎样在wincam中合并两个文件
- 将两个Wav文件合并为一个
- 合并两个格式相同的wav文件
- 用xslt合并两个xml文件
- Java合并两个文件,Set去重。
- CMD TYPE 命令合并两个文件
- 如何将两个hex文件合并
- Apache Hadoop 2.2.0 HDFS HA + YARN多机部署
- 关于Eclipse部署web项目到tomcat插件,启动成功但运行报错org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(Lja
- hdu 1314 只图个1314(Java大数)
- 药易通采购过账存储过程ts_c_BillAudit 分析
- NSJSONReadingOptions翻译
- 合并两个文件
- ADT Example
- 正则表达式匹配url的一种思路
- 简介html
- jboss5_x与jdk1_6冲突问题的解决方案
- 消除 activity 启动时白屏、黑屏问题
- 关于canvas的学习心得(三)(计算错误)
- 码流 / 码率 / 比特率 / 帧速率 / 分辨率 / 高清的区别
- 设计师2大必备HTML动画工具