Fast JNI implementation