mirror of
https://github.com/gosticks/iota.flash.js-java-wrapper.git
synced 2025-10-16 11:45:40 +00:00
small patch
This commit is contained in:
parent
1b8458d824
commit
105c3bb0c6
@ -9,8 +9,6 @@ import java.io.FileInputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -27,7 +25,6 @@ public class IotaFlashBridge {
|
|||||||
|
|
||||||
public static void boot() throws IOException {
|
public static void boot() throws IOException {
|
||||||
String file = readFile(iotaLibPath, Charset.defaultCharset());
|
String file = readFile(iotaLibPath, Charset.defaultCharset());
|
||||||
|
|
||||||
engine = V8.createV8Runtime();
|
engine = V8.createV8Runtime();
|
||||||
// Eval lib into current v8 context.
|
// Eval lib into current v8 context.
|
||||||
engine.executeVoidScript(file);
|
engine.executeVoidScript(file);
|
||||||
@ -306,8 +303,7 @@ public class IotaFlashBridge {
|
|||||||
static String readFile(String path, Charset encoding)
|
static String readFile(String path, Charset encoding)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
URL url = IotaFlashBridge.class.getClassLoader().getResource(path);
|
File file = new File(IotaFlashBridge.class.getClassLoader().getResource(path).getFile());
|
||||||
File file = new File(url.getPath());
|
|
||||||
FileInputStream fis = new FileInputStream(file);
|
FileInputStream fis = new FileInputStream(file);
|
||||||
byte[] data = new byte[(int) file.length()];
|
byte[] data = new byte[(int) file.length()];
|
||||||
fis.read(data);
|
fis.read(data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user