forked from CMPundhir/JavaExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileIODemo8.java
More file actions
25 lines (24 loc) · 763 Bytes
/
FileIODemo8.java
File metadata and controls
25 lines (24 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.SequenceInputStream;
import java.util.Scanner;
class FileIODemo8{
public static void main(String[] args){
try{
FileInputStream fin1 = new FileInputStream("E:\\JAVA\\Java Classes Programs\\HelloIO5.txt");
FileInputStream fin2 = new FileInputStream("E:\\JAVA\\Java Classes Programs\\HelloIO.txt");
FileOutputStream fout = new FileOutputStream("E:\\JAVA\\Java Classes Programs\\SequenceOutput.txt");
SequenceInputStream bin = new SequenceInputStream(fin1,fin2);
int a = 0;
while((a = bin.read())!= -1){
fout.write(a);
}
fin1.close();
fin2.close();
fout.close();
bin.close();
}catch(Exception e){
System.err.println(e.getMessage());
}
}
}