|
|
@ -12,15 +12,15 @@ import java.io.IOException;
|
|
|
|
class Resources {
|
|
|
|
class Resources {
|
|
|
|
|
|
|
|
|
|
|
|
public static void cat() throws IOException {
|
|
|
|
public static void cat() throws IOException {
|
|
|
|
FileInputStream fis = null;
|
|
|
|
FileInputStream infile = null;
|
|
|
|
FileOutputStream fos = null;
|
|
|
|
FileOutputStream outfile = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
fis = new FileInputStream(new File("infile.txt"));
|
|
|
|
infile = new FileInputStream(new File("infile.txt"));
|
|
|
|
fos = new FileOutputStream(new File("outfile.txt"));
|
|
|
|
outfile = new FileOutputStream(new File("outfile.txt"));
|
|
|
|
fos.write(fis.read());
|
|
|
|
outfile.write(infile.read());
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
if (fis != null) fis.close();
|
|
|
|
if (infile != null) infile.close();
|
|
|
|
if (fos != null) fos.close();
|
|
|
|
if (outfile != null) outfile.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|