Messaging: Use try-with-resource

Change-Id: I6649517cbd990502dfcb54f078764cf05f210268
This commit is contained in:
Michael W
2024-12-16 19:10:56 +01:00
parent 2a09fa3cb9
commit 9538179c75
24 changed files with 199 additions and 455 deletions

View File

@@ -56,15 +56,12 @@ public class DebugUtils {
final File inputFile = getDebugFile(dumpFileName, false);
if (inputFile != null) {
final FileInputStream fis = new FileInputStream(inputFile);
final BufferedInputStream bis = new BufferedInputStream(fis);
try {
try (BufferedInputStream bis = new BufferedInputStream(fis)) {
// dump file
data = ByteStreams.toByteArray(bis);
if (data == null || data.length < 1) {
LogUtil.e(LogUtil.BUGLE_TAG, "receiveFromDumpFile: empty data");
}
} finally {
bis.close();
}
}
} catch (final IOException e) {