isartcanyameres/opennaas — comment on commit 59065bb6a44a34f41d1fccaa890b8b5cec100f7c
File: manticore/bundles/net.i2cat.mantychore.actionsets.junos/src/test/java/net/i2cat/mantychore/actionsets/junos/digester/test/RoutingOptionsParserTest.java line 62
By gbehrmann:

Stuff like this can be done with a one-liner using Guava:

com.google.common.io.Files.toString(new File(pathFile), CharSet.forName("UTF-8"));

Using Guava also avoids the file descriptor leak that your code has (if an IOException is thrown in read() then you never close the file, thus resulting in a file descriptor being leaked).