Java SequenceInputStream Class
Java SequenceInputStream Class declaration
Let's see the declaration for Java.io.SequenceInputStream class:
Constructors of SequenceInputStream class
Methods of SequenceInputStream class
Java SequenceInputStream Example
In this example, we are printing the data of two files testin.txt and testout.txt.
Here, we are assuming that you have two files: testin.txt and testout.txt which have following information:
Welcome to Java IO Programming.
It is the example of Java SequenceInputStream class.
After executing the program, you will get following output:
Welcome to Java IO Programming. It is the example of Java SequenceInputStream class.
Example that reads the data from two files and writes into another file
In this example, we are writing the data of two files testin1.txt and testin2.txt into another file named testout.txt.
SequenceInputStream example that reads data using enumeration
If we need to read the data from more than two files, we need to use Enumeration. Enumeration object can be obtained by calling elements() method of the Vector class. Let's see the simple example where we are reading the data from 4 files: a.txt, b.txt, c.txt and d.txt.
The a.txt, b.txt, c.txt and d.txt have following information: