Commit f45b6c52 authored by Petri Hintukainen's avatar Petri Hintukainen

BD-J: native open method was changed around j8u40

parent 66f8bcad
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
- Accept directory name (without .jar file name) in LIBBLURAY_CP. - Accept directory name (without .jar file name) in LIBBLURAY_CP.
- Improved error resilence. - Improved error resilence.
- Improve BD-J compability. - Improve BD-J compability.
- Fix Java 8u40 compability.
- Fix infinite loop with some broken HDMV menus. - Fix infinite loop with some broken HDMV menus.
2015-01-26: Version 0.7.0 2015-01-26: Version 0.7.0
......
...@@ -57,7 +57,7 @@ public class FileInputStream extends InputStream ...@@ -57,7 +57,7 @@ public class FileInputStream extends InputStream
logger.info("Using cached " + cachedName + " for " + name); logger.info("Using cached " + cachedName + " for " + name);
name = cachedName; name = cachedName;
} }
open(name); openImpl(name);
} else { } else {
/* relative paths are problematic ... */ /* relative paths are problematic ... */
/* Those should be mapped to xlet home directory, which is inside .jar file. */ /* Those should be mapped to xlet home directory, which is inside .jar file. */
...@@ -70,7 +70,7 @@ public class FileInputStream extends InputStream ...@@ -70,7 +70,7 @@ public class FileInputStream extends InputStream
logger.error("no home found for " + name + " at " + Logger.dumpStack()); logger.error("no home found for " + name + " at " + Logger.dumpStack());
throw new FileNotFoundException(name); throw new FileNotFoundException(name);
} }
open(home + name); openImpl(home + name);
} }
available = 1024; available = 1024;
...@@ -93,9 +93,22 @@ public class FileInputStream extends InputStream ...@@ -93,9 +93,22 @@ public class FileInputStream extends InputStream
available = 1024; available = 1024;
} }
private native void open(String name) throws FileNotFoundException; /* open()/open0() wrapper to select correct native method at runtime */
private void openImpl(String name) throws FileNotFoundException {
try {
open(name);
} catch (UnsatisfiedLinkError e) {
/* OpenJDK 8 b40 */
open0(name);
}
}
private native int readBytes(byte b[], int off, int len) throws IOException; private native int readBytes(byte b[], int off, int len) throws IOException;
private native int close0(); private native int close0();
/* OpenJDK 6, OpenJDK 7, PhoneME, ... */
private native void open(String name) throws FileNotFoundException;
/* OpenJDK 8 */
private native void open0(String name) throws FileNotFoundException;
//public native int read() throws IOException; //public native int read() throws IOException;
//public native long skip(long n) throws IOException; //public native long skip(long n) throws IOException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment