[toolchain] Move write files to runtime utils
package uk.ac.manchester.tornado.runtime.common;
import static uk.ac.manchester.tornado.runtime.common.Tornado.error;
+import static uk.ac.manchester.tornado.runtime.common.Tornado.info;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
@@ -384,6 +386,15 @@ public class RuntimeUtilities {
}
+ public static void writeToFile(String file, byte[] binary) {
+ info("dumping binary %s", file);
+ try (FileOutputStream fis = new FileOutputStream(file);) {
+ fis.write(binary);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
private RuntimeUtilities() {
}
