- public class test{
- public static void main(String args[]) throws IOException{
- File f1 = new File("d:/jk.txt");
- File f2 = new File("d:/kj.txt");
- File f3 = new File("d:/jj.txt");
- FileInputStream fis = new FileInputStream(f1);
- FileInputStream fis1 = new FileInputStream(f2);
- InputStream sis = new SequenceInputStream(fis, fis1);
- InputStreamReader isr = new InputStreamReader(sis);
- FileOutputStream fos = new FileOutputStream(f3, true);
- OutputStreamWriter osw = new OutputStreamWriter(fos);
- int c;
- while((c=isr.read())!=-1){
- osw.write((char)c);
- }
- System.out.println("ok....");
- isr.close();
- osw.close();
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/0611201410905.html
来源: http://www.codesnippet.cn/detail/0611201410905.html