//example of sequence input stream class use only for get data of two files at a time--
PROGRAM CODE---
import java.io.*;
class GetMore
{
public static void main(String a[])throws Exception
{
FileInputStream f1 = new FileInputStream("data1.txt");
FileInputStream f2 = new FileInputStream("data2.txt");
SequenceInputStream s =new SequenceInputStream(f1,f2);
FileOutputStream f0 = new FileOutputStream("data3.txt");
int i;
while((i=s.read())!=-1)
{
f0.write(i);
}
System.out.println("successfully data transferred");
}
}
THIS IS FIRST DATA FILE...
THIS IS SECOND DATA FILE....
OUTPUT OF ABOVE PROGRAM---





Comments
Post a Comment