1 FileInputStream in = null;
2 FileOutputStream out = null;
3
4 try {
5 in = new FileInputStream("input.txt");
6 out = new FileOutputStream("out.txt");
7 int c;
8
9 while ((c = in.read()) != -1) {
10 out.write(c);
11 }
12 } finally {
13 if (in != null) {
14 in.close();
15 }
16 if (out != null) {
17 out.close();
18 }
19 }