com.jtransc.util.JTranscFiles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-rt-core Show documentation
Show all versions of jtransc-rt-core Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package com.jtransc.util;
import java.io.*;
import java.util.Arrays;
public class JTranscFiles {
static public boolean write(File file, byte[] data) {
try {
FileOutputStream fos = new FileOutputStream(file);
fos.write(data);
fos.close();
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}
static public byte[] read(File file) throws IOException {
byte[] out = new byte[(int) file.length()];
FileInputStream s = new FileInputStream(file);
int readed = s.read(out);
s.close();
return (readed != out.length) ? Arrays.copyOf(out, readed) : out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy