今天看到第20天的视频,可是前边关于集合的几个视频没有看,我想今天的问题就出在这里
import java.io.*;
import java.util.*;
class SequenceDemo
{
public static void main(String[] args) throws IOException
{
Vector <FileInputStream>v =new Vector <FileInputStream>();
v.add(new FileInputStream("d:\\1.txt"));
v.add(new FileInputStream("d:\\2.txt"));
Enumeration <FileInputStream> en=v.elements();
SequenceInputStream sis=new SequenceInputStream(en);
FileOutputStream fos=new FileOutputStream("d:\\3.txt");
byte[] buf=new byte[1024];
int len =0;
while ((len=sis.read(buf))!=-1)
{
fos.write(buf,0,len);
}
fos.close();
sis.close();
}
}
Enumeration <FileInputStream> en=v.elements();是在哪个视频中出现的?
|