import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Vector;
public class SequenceInputStream {
public static void main(String[] args) throws Exception {
Vector<FileInputStream> v = new Vector<FileInputStream>();
v.add(new FileInputStream("123.txt"));
v.add(new FileInputStream("javalist.txt"));
Enumeration<FileInputStream> en = v.elements();
SequenceInputStream sis = new SequenceInputStream(en);
FileOutputStream fos = new FileOutputStream("sssssss.txt");
byte[] buf = new byte[1024];
int len=0;
while((len=sis.read(buf))!=-1)
{
fos.write(buf, 0, len);
}
sis.clone();
fos.close();
}
}
这个错误怎么解决?谢谢各位了
|
|