hello
i am facing a problem in the following program based on SequenceInputStream class.i am getting a compile time error as following
Sequence.java:63:cannot resolve symbol
symbol : constructor SequenceInputStream(S)
location: class java.io.SequenceInputStream
InputStream d=new SequenceInputStream(s);
^
The program is as follows:
import java.io.*;
import java.util.*;
class Seq implements Iterator
{
private
String[] g;
private int f=0;
public Seq(String[] g)
{
this.g=g;
}
//----------------------------------------------------------
public boolean hasNext()
{
if(f<g.length)>
{
return true;
}
else
{
return false;
}
}
//-------------------------------------------------------
public Object next()
{
InputStream i=null;
if(!hasNext())
{
throw new NoSuchElementException("no more files");
}
else
{
String next=g[f];
f++;
try{i=new FileInputStream(next);}
catch(FileNotFoundException e){
System.err.println("ListOfFiles: Can't open " + next);}
}
return i;
}
//----------------------------------------------------
public void remove()
{}
}
//---------------------------------------------------
public class Sequence
{
public static void main(String[] args) throws IOException
{
S s=new S(args);
InputStream d = new SequenceInputStream(s);
int j;
while ((j = d.read()) != -1)
System.out.write(j);
d.close();
}
}
Any help will be highly appreciated.
Thanks
Smriti Singla
[This message has been edited by smriti singla (edited January 21, 2001).]