//完成SequenceInputStream合并流的读取 package work; import java.io.*; public class Sequen { public static void main(String[] args) throws IOException { FileInputStream fr = new FileInputStream("H:\\a.txt");//输入流 FileInputStream fr1 = new FileInputStream("H:\\red.txt");//输入流 SequenceInputStream sm = new SequenceInputStream(fr, fr1);//合并读取 int a = 0; byte[] b = new byte[1024]; while ((a = sm.read(b))!=-1){ System.out.println(new String(b,0,a)); } fr.close(); fr1.close(); sm.close(); } }
//完成SequenceInputStream合并流的读取
最新推荐文章于 2024-04-19 10:00:00 发布