IO流,序列流。SequenceInputStream

public  static void main(string[] args){

  FileInputStream fisl = new FileInputStream ("a.txt");   //创建字节输入流关联a.txt文件

  FileInputStream fis2 = new FileInputStream ("b.txt");

  SequenceInputStream sis = new SequenceInputStream (fis1,fis2);      //将两个流整合成一个流

  FileOutputStream fos = new FileOutputStream ("c.txt");

   int b1;

  while((b = sis.read() != -1){

    fos.write(b);

  }

  sis.close();    //sis在关闭的时候,会将构造方法中传入的流对象也都关闭掉

  fos.close();

}

posted @ 2020-07-01 22:03  一块  阅读(123)  评论(0编辑  收藏  举报