xxxxxxxxxx
try (InputStream is = new FileInputStream("application.json");
OutputStream os = new FileOutputStream("application.log")) {
// code to read from input stream and write to output stream
} catch (IOException e) {
// exception handling code
}
xxxxxxxxxx
InputStream is = null;
OutputStream os = null;
try {
is = new FileInputStream("application.json")
os = new FileOutPutStream("application.log")
}catch (IOException io) {
}finally {
is.close();
os.close()
}