#798 close file streams after export

This commit is contained in:
honfika@gmail.com
2015-02-11 18:26:22 +01:00
parent 4106f764bf
commit f2922421cb
8 changed files with 45 additions and 37 deletions

View File

@@ -1119,7 +1119,9 @@ public class CommandLineArgumentParser {
String xml = Helper.readTextFile(args.pop());
SWF swf = new SWF();
new SwfXmlImporter().importSwf(swf, xml);
swf.saveTo(new BufferedOutputStream(new FileOutputStream(args.pop())));
try (FileOutputStream fos = new FileOutputStream(new File(args.pop()))) {
swf.saveTo(new BufferedOutputStream(fos));
}
} catch (IOException ex) {
Logger.getLogger(CommandLineArgumentParser.class.getName()).log(Level.SEVERE, null, ex);
}