always use buffered output streams when writing to a file, faster swf xml export by caching the fields

This commit is contained in:
2015-05-01 01:04:08 +02:00
parent 1429757552
commit fce4534aed
18 changed files with 78 additions and 34 deletions
@@ -106,10 +106,12 @@ import com.jpexs.decompiler.graph.model.TernarOpItem;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import com.jpexs.decompiler.graph.model.WhileItem;
import com.jpexs.helpers.Helper;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -2429,7 +2431,7 @@ public class ActionScriptParser {
ABC abc = new ABC(null);
ActionScriptParser parser = new ActionScriptParser(abc, playerABCs);
parser.addScript(new String(Helper.readFile(src), "UTF-8"), true, src, classPos);
try (FileOutputStream fos = new FileOutputStream(new File(dst))) {
try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(new File(dst)))) {
abc.saveToStream(fos);
}
} catch (Exception ex) {