It works well "new FileInputStream(f.getAbsoluteFile())"
private byte[] loadFile(String path) throws IOException {
File f = new File("./build/classes/" + path);
try (InputStream is = new FileInputStream(f.getAbsoluteFile())) {
byte[] data = loadFile(is);
return data;
}
}
And "new FileInputStream(f)"
private byte[] loadFile(String path) throws IOException {
File f = new File("./build/classes/" + path);
try (InputStream is = new FileInputStream(f)) {
byte[] data = loadFile(is);
return data;
}
}
throw exception:
java.io.FileNotFoundException: ./build/classes/traces/onmethod/ErrorDuration.class (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
I can't imagine why.