老兄你的代码有一句错误了:
Enumeration<FileInputStream> en=new SequenceInputStream(en);
正确代码:
// 定义一个集合,再往集合里面装多个流对象
Vector<FileInputStream> v=new Vector<FileInputStream>();
v.add(new FileInputStream("c:\\1.txt"));
v.add(new FileInputStream("c:\\2.txt"));
v.add(new FileInputStream("c:\\3.txt"));
Enumeration<FileInputStream> en=v.elements(); //通过集合获得Enumeration
//多个流对象变成一个流对象了,,,要传入一个Enumeration,,Vector集合里面有Enumeration
SequenceInputStream sis = new SequenceInputStream(en);
FileOutputStream fos=new FileOutputStream("c:\\4.txt");
|