Provides some methods that are possible in JNI, but not possible in Java (without using Unsafe etc.)
callTypeMethod
andinvokeType
methods are 30x+ slower than reflection (68.447 ± 30.569 ns/op)- Method with
java.lang.Void
parameter type is not supported and will crash the JVM when trying to invoke them - You need to use
BoxedValue
class to pass the value of boxed primitive type to method, for example:
<repositories>
...
<repository>
<id>blueberrymc-repo</id>
<url>https://repo.blueberrymc.net/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.blueberrymc</groupId>
<artifactId>native-util</artifactId>
<version>[version]</version>
</dependency>
</dependencies>
repositories {
maven {
url "https://repo.blueberrymc.net/repository/maven-public/"
}
}
dependencies {
implementation 'net.blueberrymc:native-util:[version]'
}
repositories {
maven { url = uri("https://repo.blueberrymc.net/repository/maven-public/") }
}
dependencies {
implementation("net.blueberrymc:native-util:[version]")
}