package com.jsl.io;
import java.io.FileInputStream;
import java.io.SequenceInputStream;
import java.util.Vector;
public class ReadingData {
public static void main(String[] args) {
FileInputStream fis1 = null;
FileInputStream fis2 = null;
SequenceInputStream seq = null;
try {
fis1 = new FileInputStream("One.txt");
fis2 = new FileInputStream("one.txt");
Vector vector = new Vector();
vector.add(fis1);
vector.add(fis2);
seq = new SequenceInputStream(vector.elements());
int ch;
while ((ch = seq.read()) != -1) {
System.out.print((char) ch);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
seq.close();
fis1.close();
fis2.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Tuesday, August 21, 2012
Reading Multiple files data using SequenceInputStream Object
Subscribe to:
Post Comments (Atom)
Spring Boot 3 : JWT with SecurityFilterChain, AuthorizeHttpRequests, RequestMatchers
pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0...
-
Expression Language A primary feature of JSP technology version 2.0 is its support for an expression language (EL). An expres...
-
pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0...
No comments:
Post a Comment