mercredi 1 juillet 2015

Does collect operation on Stream close the stream and underlying resources?

Does below code need to be wrapped in try-with-resources to make sure underlying file is closed?

`List<String> rows = Files.lines(inputFilePath).collect(Collectors.toList());`

Aucun commentaire:

Enregistrer un commentaire