Using FileUtils.copyFile instead of dealing with raw streams

This commit is contained in:
Federico Fissore 2015-05-13 10:16:09 +02:00
parent 166c1aa7bb
commit 90a533b82c
1 changed files with 1 additions and 11 deletions

View File

@ -1158,7 +1158,6 @@ public class Compiler implements MessageConsumer {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + BaseNoGui.REVISION);
String[] cmdArray;
try {
String tmp_file = prefs.getOrExcept("recipe.output.tmp_file");
tmp_file = StringReplacer.replaceFromMapping(tmp_file, dict);
@ -1168,16 +1167,7 @@ public class Compiler implements MessageConsumer {
File hexFile = new File(prefs.get("build.path") + "/" + tmp_file);
File saveFile = new File(sketch.getFolder().getAbsolutePath() + "/" + save_file);
FileReader in = new FileReader(hexFile);
FileWriter out = new FileWriter(saveFile);
int c;
while ((c = in.read()) != -1)
out.write(c);
in.close();
out.close();
FileUtils.copyFile(hexFile, saveFile);
} catch (Exception e) {
throw new RunnerException(e);
}