new SequenceInputStream(Enumeration arg0) : SequenceInputStream « java.io « Java by API






new SequenceInputStream(Enumeration arg0)

 


import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.SequenceInputStream;
import java.util.Vector;

public class Main {

  public static void main(String[] args) throws IOException {

    Vector theStreams = new Vector();

    for (int i = 0; i < args.length; i++) {
      FileInputStream fin = new FileInputStream(args[i]);
      theStreams.addElement(fin);
    }

    InputStream in = new SequenceInputStream(theStreams.elements());
    for (int i = in.read(); i != -1; i = in.read()) {
      System.out.write(i);
    }
  }
}

   
  








Related examples in the same category

1.new SequenceInputStream(InputStream s1, InputStream s2)
2.SequenceInputStream: close()
3.SequenceInputStream: read()