本帖最后由 徐帅 于 2012-7-21 11:52 编辑
为什么会出现以下几个提示呢?
请各位帮忙看下。谢谢了
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Enumeration;
import java.util.Vector;
public class SequenceInputStream {
public static void main(String[] args) throws FileNotFoundException{
Vector<FileInputStream> vector = new Vector<FileInputStream>();
vector.add(new FileInputStream("d:\\2.txt"));
vector.add(new FileInputStream("d:\\3.txt"));
vector.add(new FileInputStream("d:\\1.txt"));
Enumeration<FileInputStream> en = vector.elements();
SequenceInputStream sis = new SequenceInputStream(en); //The constructor SequenceInputStream(Enumeration<FileInputStream>) is undefined
FileOutputStream fos = new FileOutputStream("d:\\4.txt");
int len = 0;
byte[] buf = new byte[1024];
while((len =sis.read(buf))!= -1){ //The method read(byte[]) is undefined for the type SequenceInputStream
fos.write(buf,0,len);
}
fos.close();
sis.close(); //The method close() is undefined for the type SequenceInputStream
}
}
|
|