import java.io.*; class combinefile{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //get the path of file System.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 inputstream FileInputStream fis1 = new FileInputStream(file1); FileInputStream fis2 = new FileInputStream(file2); //transform file3 object into outputstream FileOutputStream fos = new FileOutputStream(file3); //combine two stream into one stream InputStream is = new SequenceInputStream(fis1,fis2); int c; while((c=is.read())!=-1) { fos.write((char)c); } System.out.println("OK"); is.close(); fos.close(); } }


qwqw900619 LV4
2022年7月16日
yuqi886 LV5
2022年4月16日
LI4985823 LV1
2021年6月9日
李海洋 LV12
2021年5月26日
琴海森林 LV9
2020年3月3日
学习使我快乐ha LV1
2018年12月17日
g1121345342 LV9
2018年12月13日
1847731288 LV13
2018年8月2日
殷雪君 LV1
2018年7月2日
297791083 LV1
2018年5月15日