I want to read and write in the same try-with-resource for a very large file. Do try-with-resource take care of the exceptions thrown with in the its body.
try (Stream<String> stream = Files.lines(Paths.get("source.txt"), Charset.defaultCharset());
BufferedWriter writer = Files.newBufferedWriter(Paths.get("dest.txt"))) {
stream.map(String::trim).map(String::toUpperCase).forEach(writer::write);
} catch (Exception e) {
e.printStackTrace();
}