Merge pull request #130 from joshuawarner32/openjdk-files-compat

fix FileInputStream for newer openjdk7 versions
This commit is contained in:
Joel Dice 2013-12-07 18:52:51 -08:00
commit 8c3f3b268a

View File

@ -2004,8 +2004,13 @@ interceptFileOperations(Thread* t, bool updateRuntimeData)
intercept(t, fileInputStreamClass, "open", "(Ljava/lang/String;)V",
voidPointer(openFile), updateRuntimeData);
intercept(t, fileInputStreamClass, "read", "()I",
voidPointer(readByteFromFile), updateRuntimeData);
if(findMethodOrNull(t, fileInputStreamClass, "read0", "()I") != 0) {
intercept(t, fileInputStreamClass, "read0", "()I",
voidPointer(readByteFromFile), updateRuntimeData);
} else {
intercept(t, fileInputStreamClass, "read", "()I",
voidPointer(readByteFromFile), updateRuntimeData);
}
intercept(t, fileInputStreamClass, "readBytes", "([BII)I",
voidPointer(readBytesFromFile), updateRuntimeData);