class hello {
public static void main(String[] args) throws IOException {
FileInputStream input1 = new FileInputStream("input1.txt");
FileInputStream input2 = new FileInputStream("input2.txt");
SequenceInputStream SIS = new SequenceInputStream(input1, input2);
FileOutputStream output = new FileOutputStream("output.txt");
int a;
while((a = SIS.read()) != -1) {
output.write(a);
}
input1.close();
input2.close();
SIS.close();
output.close();
}
运行结果: