Close file properly on compressWUDToWUX function

This commit is contained in:
Maschell 2019-04-24 13:25:22 +02:00
parent 254d16a584
commit 03181f6078

View File

@ -92,6 +92,7 @@ public final class WUDService {
log.info("Writing compressed file to: " + outputFile.getAbsolutePath()); log.info("Writing compressed file to: " + outputFile.getAbsolutePath());
RandomAccessFile fileOutput = new RandomAccessFile(outputFile, "rw"); RandomAccessFile fileOutput = new RandomAccessFile(outputFile, "rw");
try {
WUDImageCompressedInfo info = WUDImageCompressedInfo.getDefaultCompressedInfo(); WUDImageCompressedInfo info = WUDImageCompressedInfo.getDefaultCompressedInfo();
@ -163,7 +164,9 @@ public final class WUDService {
} }
fileOutput.write(buffer.array()); fileOutput.write(buffer.array());
} finally {
fileOutput.close(); fileOutput.close();
}
return Optional.of(outputFile); return Optional.of(outputFile);
} }