SES-1791 : Use try-with-resources to output streams closed automatically