jni

package
v0.0.0-...-a3940bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// To prevent the values from not being defined in C side,
	// actual values are used.
	JNIInvalidRefType    = 0
	JNILocalRefType      = 1
	JNIGlobalRefType     = 2
	JNIWeakGlobalRefType = 3
)

jni.h:

/* Return values from jobjectRefType */
typedef enum _jobjectType {
    JNIInvalidRefType    = 0,
    JNILocalRefType      = 1,
    JNIGlobalRefType     = 2,
    JNIWeakGlobalRefType = 3
} jobjectRefType;
View Source
const (
	JNI_FALSE = 0
	JNI_TRUE  = 1
)

jni.h:

/*
 * jboolean constants
 */

#define JNI_FALSE 0
#define JNI_TRUE 1
View Source
const (
	JNI_OK        = 0
	JNI_ERR       = -1
	JNI_EDETACHED = -2
	JNI_EVERSION  = -3
	JNI_ENOMEM    = -4
	JNI_EEXIST    = -5
	JNI_EINVAL    = -6
)

jni.h:

/*
 * possible return values for JNI functions.
 */

#define JNI_OK           0                 /* success */
#define JNI_ERR          (-1)              /* unknown error */
#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
#define JNI_EVERSION     (-3)              /* JNI version error */
#define JNI_ENOMEM       (-4)              /* not enough memory */
#define JNI_EEXIST       (-5)              /* VM already created */
#define JNI_EINVAL       (-6)              /* invalid arguments */
View Source
const (
	JNI_COMMIT = 1
	JNI_ABORT  = 2
)

jni.h:

/*
 * used in ReleaseScalarArrayElements
 */

#define JNI_COMMIT 1
#define JNI_ABORT 2

Variables

View Source
var Errors = []error{
	errors.New("JNI_OK: Success"),
	errors.New("JNI_ERR: Unknown error"),
	errors.New("JNI_EDETACHED: Thread detached from the VM"),
	errors.New("JNI_EVERSION: JNI version error"),
	errors.New("JNI_ENOMEM: Not enough memory"),
	errors.New("JNI_EEXIST: VM already created"),
	errors.New("JNI_EINVAL: Invalid arguments"),
}
View Source
var JavaInt = func() func(int) C.jint {

	if ^uint(0)>>32 == 0 {
		return JavaIntFor32Bit
	}
	return JavaIntFor64Bit
}()

Functions

func AllocObject

func AllocObject(env *C.JNIEnv, clazz C.jclass) C.jobject

jni.h:

jobject (JNICALL *AllocObject)(JNIEnv *env, jclass clazz);

func CallBooleanMethodA

func CallBooleanMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jboolean

jni.h:

jboolean (JNICALL *CallBooleanMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jboolean (JNICALL *CallBooleanMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jboolean (JNICALL *CallBooleanMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);

func CallByteMethodA

func CallByteMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jbyte

jni.h:

jbyte (JNICALL *CallByteMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jbyte (JNICALL *CallByteMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jbyte (JNICALL *CallByteMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallCharMethodA

func CallCharMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jchar

jni.h:

jchar (JNICALL *CallCharMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jchar (JNICALL *CallCharMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jchar (JNICALL *CallCharMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallDoubleMethodA

func CallDoubleMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jdouble

jni.h:

jdouble (JNICALL *CallDoubleMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jdouble (JNICALL *CallDoubleMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jdouble (JNICALL *CallDoubleMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallFloatMethodA

func CallFloatMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jfloat

jni.h:

jfloat (JNICALL *CallFloatMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jfloat (JNICALL *CallFloatMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jfloat (JNICALL *CallFloatMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallIntMethodA

func CallIntMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jint

jni.h:

jint (JNICALL *CallIntMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jint (JNICALL *CallIntMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jint (JNICALL *CallIntMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallLongMethodA

func CallLongMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jlong

jni.h:

jlong (JNICALL *CallLongMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jlong (JNICALL *CallLongMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jlong (JNICALL *CallLongMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallNonvirtualBooleanMethodA

func CallNonvirtualBooleanMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jboolean

jni.h:

jboolean (JNICALL *CallNonvirtualBooleanMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jboolean (JNICALL *CallNonvirtualBooleanMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jboolean (JNICALL *CallNonvirtualBooleanMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args);

func CallNonvirtualByteMethodA

func CallNonvirtualByteMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jbyte

jni.h:

jbyte (JNICALL *CallNonvirtualByteMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jbyte (JNICALL *CallNonvirtualByteMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jbyte (JNICALL *CallNonvirtualByteMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualCharMethodA

func CallNonvirtualCharMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jchar

jni.h:

jchar (JNICALL *CallNonvirtualCharMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jchar (JNICALL *CallNonvirtualCharMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jchar (JNICALL *CallNonvirtualCharMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualDoubleMethodA

func CallNonvirtualDoubleMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jdouble

jni.h:

jdouble (JNICALL *CallNonvirtualDoubleMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jdouble (JNICALL *CallNonvirtualDoubleMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jdouble (JNICALL *CallNonvirtualDoubleMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualFloatMethodA

func CallNonvirtualFloatMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jfloat

jni.h:

jfloat (JNICALL *CallNonvirtualFloatMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jfloat (JNICALL *CallNonvirtualFloatMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jfloat (JNICALL *CallNonvirtualFloatMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualIntMethodA

func CallNonvirtualIntMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jint

jni.h:

jint (JNICALL *CallNonvirtualIntMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jint (JNICALL *CallNonvirtualIntMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jint (JNICALL *CallNonvirtualIntMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualLongMethodA

func CallNonvirtualLongMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jlong

jni.h:

jlong (JNICALL *CallNonvirtualLongMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jlong (JNICALL *CallNonvirtualLongMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jlong (JNICALL *CallNonvirtualLongMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualObjectMethodA

func CallNonvirtualObjectMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jobject

jni.h:

jobject (JNICALL *CallNonvirtualObjectMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *CallNonvirtualObjectMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jobject (JNICALL *CallNonvirtualObjectMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args);

func CallNonvirtualShortMethodA

func CallNonvirtualShortMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jshort

jni.h:

jshort (JNICALL *CallNonvirtualShortMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jshort (JNICALL *CallNonvirtualShortMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
jshort (JNICALL *CallNonvirtualShortMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args);

func CallNonvirtualVoidMethodA

func CallNonvirtualVoidMethodA(env *C.JNIEnv, obj C.jobject, clazz C.jclass, methodID C.jmethodID, args *C.jvalue)

jni.h:

void (JNICALL *CallNonvirtualVoidMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
void (JNICALL *CallNonvirtualVoidMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args);
void (JNICALL *CallNonvirtualVoidMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args);

func CallObjectMethodA

func CallObjectMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jobject

jni.h:

jobject (JNICALL *CallObjectMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jobject (JNICALL *CallObjectMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jobject (JNICALL *CallObjectMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);

func CallShortMethodA

func CallShortMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue) C.jshort

jni.h:

jshort (JNICALL *CallShortMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jshort (JNICALL *CallShortMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jshort (JNICALL *CallShortMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);

func CallStaticBooleanMethodA

func CallStaticBooleanMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jboolean

jni.h:

jboolean (JNICALL *CallStaticBooleanMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jboolean (JNICALL *CallStaticBooleanMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jboolean (JNICALL *CallStaticBooleanMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticByteMethodA

func CallStaticByteMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jbyte

jni.h:

jbyte (JNICALL *CallStaticByteMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jbyte (JNICALL *CallStaticByteMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jbyte (JNICALL *CallStaticByteMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticCharMethodA

func CallStaticCharMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jchar

jni.h:

jchar (JNICALL *CallStaticCharMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jchar (JNICALL *CallStaticCharMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jchar (JNICALL *CallStaticCharMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticDoubleMethodA

func CallStaticDoubleMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jdouble

jni.h:

jdouble (JNICALL *CallStaticDoubleMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jdouble (JNICALL *CallStaticDoubleMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jdouble (JNICALL *CallStaticDoubleMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticFloatMethodA

func CallStaticFloatMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jfloat

jni.h:

jfloat (JNICALL *CallStaticFloatMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jfloat (JNICALL *CallStaticFloatMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jfloat (JNICALL *CallStaticFloatMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticIntMethodA

func CallStaticIntMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jint

jni.h:

jint (JNICALL *CallStaticIntMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jint (JNICALL *CallStaticIntMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jint (JNICALL *CallStaticIntMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticLongMethodA

func CallStaticLongMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jlong

jni.h:

jlong (JNICALL *CallStaticLongMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jlong (JNICALL *CallStaticLongMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jlong (JNICALL *CallStaticLongMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticObjectMethodA

func CallStaticObjectMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jobject

jni.h:

jobject (JNICALL *CallStaticObjectMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *CallStaticObjectMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jobject (JNICALL *CallStaticObjectMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticShortMethodA

func CallStaticShortMethodA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jshort

jni.h:

jshort (JNICALL *CallStaticShortMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jshort (JNICALL *CallStaticShortMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jshort (JNICALL *CallStaticShortMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func CallStaticVoidMethodA

func CallStaticVoidMethodA(env *C.JNIEnv, cls C.jclass, methodID C.jmethodID, args *C.jvalue)

jni.h:

void (JNICALL *CallStaticVoidMethod)(JNIEnv *env, jclass cls, jmethodID methodID, ...);
void (JNICALL *CallStaticVoidMethodV)(JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
void (JNICALL *CallStaticVoidMethodA)(JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);

func CallVoidMethodA

func CallVoidMethodA(env *C.JNIEnv, obj C.jobject, methodID C.jmethodID, args *C.jvalue)

jni.h:

void (JNICALL *CallVoidMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...);
void (JNICALL *CallVoidMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
void (JNICALL *CallVoidMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);

func DefineClass

func DefineClass(env *C.JNIEnv, name *C.char, loader C.jobject, buf *C.jbyte, _len C.jsize) C.jclass

jni.h:

jclass (JNICALL *DefineClass)(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len);

func DeleteGlobalRef

func DeleteGlobalRef(env *C.JNIEnv, gref C.jobject)

jni.h:

void (JNICALL *DeleteGlobalRef)(JNIEnv *env, jobject gref);

func DeleteLocalRef

func DeleteLocalRef(env *C.JNIEnv, obj C.jobject)

jni.h:

void (JNICALL *DeleteLocalRef)(JNIEnv *env, jobject obj);

func DeleteWeakGlobalRef

func DeleteWeakGlobalRef(env *C.JNIEnv, ref C.jweak)

jni.h:

void (JNICALL *DeleteWeakGlobalRef)(JNIEnv *env, jweak ref);

func EnsureLocalCapacity

func EnsureLocalCapacity(env *C.JNIEnv, capacity C.jint) C.jint

jni.h:

jint (JNICALL *EnsureLocalCapacity)(JNIEnv *env, jint capacity);

func ExceptionCheck

func ExceptionCheck(env *C.JNIEnv) C.jboolean

jni.h:

jboolean (JNICALL *ExceptionCheck)(JNIEnv *env);

func ExceptionClear

func ExceptionClear(env *C.JNIEnv)

jni.h:

void (JNICALL *ExceptionClear)(JNIEnv *env);

func ExceptionDescribe

func ExceptionDescribe(env *C.JNIEnv)

jni.h:

void (JNICALL *ExceptionDescribe)(JNIEnv *env);

func ExceptionOccurred

func ExceptionOccurred(env *C.JNIEnv) C.jthrowable

jni.h:

jthrowable (JNICALL *ExceptionOccurred)(JNIEnv *env);

func FatalError

func FatalError(env *C.JNIEnv, msg *C.char)

jni.h:

void (JNICALL *FatalError)(JNIEnv *env, const char *msg);

func FindClass

func FindClass(env *C.JNIEnv, name *C.char) C.jclass

jni.h:

jclass (JNICALL *FindClass)(JNIEnv *env, const char *name);

func FromReflectedField

func FromReflectedField(env *C.JNIEnv, field C.jobject) C.jfieldID

jni.h:

jfieldID (JNICALL *FromReflectedField)(JNIEnv *env, jobject field);

func FromReflectedMethod

func FromReflectedMethod(env *C.JNIEnv, method C.jobject) C.jmethodID

jni.h:

jmethodID (JNICALL *FromReflectedMethod)(JNIEnv *env, jobject method);

func GetArrayLength

func GetArrayLength(env *C.JNIEnv, array C.jarray) C.jsize

jni.h:

jsize (JNICALL *GetArrayLength)(JNIEnv *env, jarray array);

func GetBooleanArrayElements

func GetBooleanArrayElements(env *C.JNIEnv, array C.jbooleanArray, isCopy *C.jboolean) *C.jboolean

jni.h:

jboolean * (JNICALL *GetBooleanArrayElements)(JNIEnv *env, jbooleanArray array, jboolean *isCopy);

func GetBooleanArrayRegion

func GetBooleanArrayRegion(env *C.JNIEnv, array C.jbooleanArray, start, l C.jsize, buf *C.jboolean)

jni.h:

void (JNICALL *GetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);

func GetBooleanField

func GetBooleanField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jboolean

jni.h:

jboolean (JNICALL *GetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetByteArrayElements

func GetByteArrayElements(env *C.JNIEnv, array C.jbyteArray, isCopy *C.jboolean) *C.jbyte

jni.h:

jbyte * (JNICALL *GetByteArrayElements)(JNIEnv *env, jbyteArray array, jboolean *isCopy);

func GetByteArrayRegion

func GetByteArrayRegion(env *C.JNIEnv, array C.jbyteArray, start, _len C.jsize, buf *C.jbyte)

jni.h:

void (JNICALL *GetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);

func GetByteField

func GetByteField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jbyte

jni.h:

jbyte (JNICALL *GetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetCJArray

func GetCJArray(arr unsafe.Pointer) C.jarray

func GetCJBoolean

func GetCJBoolean(z unsafe.Pointer) *C.jboolean

func GetCJBooleanArray

func GetCJBooleanArray(arr unsafe.Pointer) C.jbooleanArray

func GetCJByte

func GetCJByte(b unsafe.Pointer) *C.jbyte

func GetCJByteArray

func GetCJByteArray(arr unsafe.Pointer) C.jbyteArray

func GetCJChar

func GetCJChar(c unsafe.Pointer) *C.jchar

func GetCJCharArray

func GetCJCharArray(arr unsafe.Pointer) C.jcharArray

func GetCJClass

func GetCJClass(clazz unsafe.Pointer) C.jclass

func GetCJDouble

func GetCJDouble(d unsafe.Pointer) *C.jdouble

func GetCJDoubleArray

func GetCJDoubleArray(arr unsafe.Pointer) C.jdoubleArray

func GetCJFieldID

func GetCJFieldID(fieldID unsafe.Pointer) C.jfieldID

func GetCJFloat

func GetCJFloat(f unsafe.Pointer) *C.jfloat

func GetCJFloatArray

func GetCJFloatArray(arr unsafe.Pointer) C.jfloatArray

func GetCJInt

func GetCJInt(i unsafe.Pointer) *C.jint

func GetCJIntArray

func GetCJIntArray(arr unsafe.Pointer) C.jintArray

func GetCJLong

func GetCJLong(j unsafe.Pointer) *C.jlong

func GetCJLongArray

func GetCJLongArray(arr unsafe.Pointer) C.jlongArray

func GetCJMethodID

func GetCJMethodID(methodID unsafe.Pointer) C.jmethodID

func GetCJNIEnv

func GetCJNIEnv(env unsafe.Pointer) *C.JNIEnv

func GetCJNINativeMethod

func GetCJNINativeMethod(method unsafe.Pointer) *C.JNINativeMethod

func GetCJObject

func GetCJObject(obj unsafe.Pointer) C.jobject

func GetCJObjectArray

func GetCJObjectArray(arr unsafe.Pointer) C.jobjectArray

func GetCJShort

func GetCJShort(s unsafe.Pointer) *C.jshort

func GetCJShortArray

func GetCJShortArray(arr unsafe.Pointer) C.jshortArray

func GetCJSize

func GetCJSize(i unsafe.Pointer) *C.jsize

func GetCJString

func GetCJString(str unsafe.Pointer) C.jstring

func GetCJThrowable

func GetCJThrowable(throw unsafe.Pointer) C.jthrowable

func GetCJValue

func GetCJValue(v unsafe.Pointer) *C.jvalue

func GetCJWeak

func GetCJWeak(weak unsafe.Pointer) C.jweak

func GetCJavaVM

func GetCJavaVM(vm unsafe.Pointer) *C.JavaVM

func GetCharArrayElements

func GetCharArrayElements(env *C.JNIEnv, array C.jcharArray, isCopy *C.jboolean) *C.jchar

jni.h:

jchar * (JNICALL *GetCharArrayElements)(JNIEnv *env, jcharArray array, jboolean *isCopy);

func GetCharArrayRegion

func GetCharArrayRegion(env *C.JNIEnv, array C.jcharArray, start, _len C.jsize, buf *C.jchar)

jni.h:

void (JNICALL *GetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);

func GetCharField

func GetCharField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jchar

jni.h:

jchar (JNICALL *GetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetDefaultJNIEnv

func GetDefaultJNIEnv() *C.JNIEnv

TODO: Implement this!

func GetDefaultJavaVM

func GetDefaultJavaVM() *C.JavaVM

func GetDirectBufferAddress

func GetDirectBufferAddress(env *C.JNIEnv, buf C.jobject) unsafe.Pointer

jni.h:

void* (JNICALL *GetDirectBufferAddress)(JNIEnv* env, jobject buf);

func GetDirectBufferCapacity

func GetDirectBufferCapacity(env *C.JNIEnv, buf C.jobject) C.jlong

jni.h:

jlong (JNICALL *GetDirectBufferCapacity)(JNIEnv* env, jobject buf);

func GetDoubleArrayElements

func GetDoubleArrayElements(env *C.JNIEnv, array C.jdoubleArray, isCopy *C.jboolean) *C.jdouble

jni.h:

jdouble * (JNICALL *GetDoubleArrayElements)(JNIEnv *env, jdoubleArray array, jboolean *isCopy);

func GetDoubleArrayRegion

func GetDoubleArrayRegion(env *C.JNIEnv, array C.jdoubleArray, start, _len C.jsize, buf *C.jdouble)

jni.h:

void (JNICALL *GetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);

func GetDoubleField

func GetDoubleField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jdouble

jni.h:

jdouble (JNICALL *GetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetFieldID

func GetFieldID(env *C.JNIEnv, clazz C.jclass, name, sig *C.char) C.jfieldID

jni.h:

jfieldID (JNICALL *GetFieldID)(JNIEnv *env, jclass clazz, const char *name, const char *sig);

func GetFloatArrayElements

func GetFloatArrayElements(env *C.JNIEnv, array C.jfloatArray, isCopy *C.jboolean) *C.jfloat

jni.h:

jfloat * (JNICALL *GetFloatArrayElements)(JNIEnv *env, jfloatArray array, jboolean *isCopy);

func GetFloatArrayRegion

func GetFloatArrayRegion(env *C.JNIEnv, array C.jfloatArray, start, _len C.jsize, buf *C.jfloat)

jni.h:

void (JNICALL *GetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);

func GetFloatField

func GetFloatField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jfloat

jni.h:

jfloat (JNICALL *GetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetIntArrayElements

func GetIntArrayElements(env *C.JNIEnv, array C.jintArray, isCopy *C.jboolean) *C.jint

jni.h:

jint * (JNICALL *GetIntArrayElements)(JNIEnv *env, jintArray array, jboolean *isCopy);

func GetIntArrayRegion

func GetIntArrayRegion(env *C.JNIEnv, array C.jintArray, start, _len C.jsize, buf *C.jint)

jni.h:

void (JNICALL *GetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);

func GetIntField

func GetIntField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jint

jni.h:

jint (JNICALL *GetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetJavaVM

func GetJavaVM(env *C.JNIEnv, vm **C.JavaVM) C.jint

jni.h:

jint (JNICALL *GetJavaVM)(JNIEnv *env, JavaVM **vm);

func GetLongArrayElements

func GetLongArrayElements(env *C.JNIEnv, array C.jlongArray, isCopy *C.jboolean) *C.jlong

jni.h:

jlong * (JNICALL *GetLongArrayElements)(JNIEnv *env, jlongArray array, jboolean *isCopy);

func GetLongArrayRegion

func GetLongArrayRegion(env *C.JNIEnv, array C.jlongArray, start, _len C.jsize, buf *C.jlong)

jni.h:

void (JNICALL *GetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);

func GetLongField

func GetLongField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jlong

jni.h:

jlong (JNICALL *GetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetMethodID

func GetMethodID(env *C.JNIEnv, clazz C.jclass, name, sig *C.char) C.jmethodID

jni.h:

jmethodID (JNICALL *GetMethodID)(JNIEnv *env, jclass clazz, const char *name, const char *sig);

func GetObjectArrayElement

func GetObjectArrayElement(env *C.JNIEnv, array C.jobjectArray, index C.jsize) C.jobject

jni.h:

jobject (JNICALL *GetObjectArrayElement)(JNIEnv *env, jobjectArray array, jsize index);

func GetObjectClass

func GetObjectClass(env *C.JNIEnv, obj C.jobject) C.jclass

jni.h:

jclass (JNICALL *GetObjectClass)(JNIEnv *env, jobject obj);

func GetObjectField

func GetObjectField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jobject

jni.h:

jobject (JNICALL *GetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetObjectRefType

func GetObjectRefType(env *C.JNIEnv, obj C.jobject) C.jobjectRefType

jni.h:

jobjectRefType (JNICALL *GetObjectRefType)(JNIEnv* env, jobject obj);

func GetPrimitiveArrayCritical

func GetPrimitiveArrayCritical(env *C.JNIEnv, array C.jarray, isCopy *C.jboolean) unsafe.Pointer

jni.h:

void * (JNICALL *GetPrimitiveArrayCritical)(JNIEnv *env, jarray array, jboolean *isCopy);

func GetPtrCChar

func GetPtrCChar(pc unsafe.Pointer) *C.char

func GetPtrCJValue

func GetPtrCJValue(pv unsafe.Pointer) *C.jvalue

func GetShortArrayElements

func GetShortArrayElements(env *C.JNIEnv, array C.jshortArray, isCopy *C.jboolean) *C.jshort

jni.h:

jshort * (JNICALL *GetShortArrayElements)(JNIEnv *env, jshortArray array, jboolean *isCopy);

func GetShortArrayRegion

func GetShortArrayRegion(env *C.JNIEnv, array C.jshortArray, start, _len C.jsize, buf *C.jshort)

jni.h:

void (JNICALL *GetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);

func GetShortField

func GetShortField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID) C.jshort

jni.h:

jshort (JNICALL *GetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID);

func GetStaticBooleanField

func GetStaticBooleanField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jboolean

jni.h:

jboolean (JNICALL *GetStaticBooleanField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticByteField

func GetStaticByteField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jbyte

jni.h:

jbyte (JNICALL *GetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticCharField

func GetStaticCharField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jchar

jni.h:

jchar (JNICALL *GetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticDoubleField

func GetStaticDoubleField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jdouble

jni.h:

jdouble (JNICALL *GetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticFieldID

func GetStaticFieldID(env *C.JNIEnv, clazz C.jclass, name, sig *C.char) C.jfieldID

jni.h:

jfieldID (JNICALL *GetStaticFieldID)(JNIEnv *env, jclass clazz, const char *name, const char *sig);

func GetStaticFloatField

func GetStaticFloatField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jfloat

jni.h:

jfloat (JNICALL *GetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticIntField

func GetStaticIntField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jint

jni.h:

jint (JNICALL *GetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticLongField

func GetStaticLongField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jlong

jni.h:

jlong (JNICALL *GetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticMethodID

func GetStaticMethodID(env *C.JNIEnv, clazz C.jclass, name, sig *C.char) C.jmethodID

jni.h:

jmethodID (JNICALL *GetStaticMethodID)(JNIEnv *env, jclass clazz, const char *name, const char *sig);

func GetStaticObjectField

func GetStaticObjectField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jobject

jni.h:

jobject (JNICALL *GetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStaticShortField

func GetStaticShortField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID) C.jshort

jni.h:

jshort (JNICALL *GetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID);

func GetStringChars

func GetStringChars(env *C.JNIEnv, str C.jstring, isCopy *C.jboolean) *C.jchar

jni.h:

const jchar *(JNICALL *GetStringChars)(JNIEnv *env, jstring str, jboolean *isCopy);

func GetStringCritical

func GetStringCritical(env *C.JNIEnv, string C.jstring, isCopy *C.jboolean) *C.jchar

jni.h:

const jchar * (JNICALL *GetStringCritical)(JNIEnv *env, jstring string, jboolean *isCopy);

func GetStringLength

func GetStringLength(env *C.JNIEnv, str C.jstring) C.jsize

jni.h:

jsize (JNICALL *GetStringLength)(JNIEnv *env, jstring str);

func GetStringRegion

func GetStringRegion(env *C.JNIEnv, str C.jstring, start, _len C.jsize, buf *C.jchar)

jni.h:

void (JNICALL *GetStringRegion)(JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);

func GetStringUTFChars

func GetStringUTFChars(env *C.JNIEnv, str C.jstring, isCopy *C.jboolean) *C.char

jni.h:

const char* (JNICALL *GetStringUTFChars)(JNIEnv *env, jstring str, jboolean *isCopy);

func GetStringUTFLength

func GetStringUTFLength(env *C.JNIEnv, str C.jstring) C.jsize

jni.h:

jsize (JNICALL *GetStringUTFLength)(JNIEnv *env, jstring str);

func GetStringUTFRegion

func GetStringUTFRegion(env *C.JNIEnv, str C.jstring, start, _len C.jsize, buf *C.char)

jni.h:

void (JNICALL *GetStringUTFRegion)(JNIEnv *env, jstring str, jsize start, jsize len, char *buf);

func GetSuperclass

func GetSuperclass(env *C.JNIEnv, sub C.jclass) C.jclass

jni.h:

jclass (JNICALL *GetSuperclass)(JNIEnv *env, jclass sub);

func GetVersion

func GetVersion(env *C.JNIEnv) C.jint

jni.h:

jint (JNICALL *GetVersion)(JNIEnv *env);

func GoBool

func GoBool(z C.jboolean) bool

func GoFloat32

func GoFloat32(f C.jfloat) float32

func GoFloat64

func GoFloat64(d C.jdouble) float64

func GoInt

func GoInt(i C.jint) int

From https://golang.org/ref/spec#Numeric_types:

uint       either 32 or 64 bits
int        same size as uint
uintptr    an unsigned integer large enough to store the
           uninterpreted bits of a pointer value

func GoInt16

func GoInt16(s C.jshort) int16

func GoInt32

func GoInt32(i C.jint) int32

func GoInt32FromSize

func GoInt32FromSize(i C.jsize) int32

func GoInt64

func GoInt64(j C.jlong) int64

func GoInt8

func GoInt8(b C.jbyte) int8

func GoIntFromSize

func GoIntFromSize(i C.jsize) int

func GoUint16

func GoUint16(c C.jchar) uint16

func IsAssignableFrom

func IsAssignableFrom(env *C.JNIEnv, sub, sup C.jclass) C.jboolean

jni.h:

jboolean (JNICALL *IsAssignableFrom)(JNIEnv *env, jclass sub, jclass sup);

func IsInstanceOf

func IsInstanceOf(env *C.JNIEnv, obj C.jobject, clazz C.jclass) C.jboolean

jni.h:

jboolean (JNICALL *IsInstanceOf)(JNIEnv *env, jobject obj, jclass clazz);

func IsSameObject

func IsSameObject(env *C.JNIEnv, obj1, obj2 C.jobject) C.jboolean

jni.h:

jboolean (JNICALL *IsSameObject)(JNIEnv *env, jobject obj1, jobject obj2);

func JNI_OnLoad

func JNI_OnLoad(vm *C.JavaVM, reserved unsafe.Pointer) C.jint

func JValueArray

func JValueArray(args ...interface{}) []C.jvalue

func JValueFromJBoolean

func JValueFromJBoolean(z C.jboolean) C.jvalue

func JValueFromJByte

func JValueFromJByte(b C.jbyte) C.jvalue

func JValueFromJChar

func JValueFromJChar(c C.jchar) C.jvalue

func JValueFromJDouble

func JValueFromJDouble(d C.jdouble) C.jvalue

func JValueFromJFloat

func JValueFromJFloat(f C.jfloat) C.jvalue

func JValueFromJInt

func JValueFromJInt(i C.jint) C.jvalue

func JValueFromJLong

func JValueFromJLong(j C.jlong) C.jvalue

func JValueFromJObject

func JValueFromJObject(l C.jobject) C.jvalue

func JValueFromJShort

func JValueFromJShort(s C.jshort) C.jvalue

func JValueToJBoolean

func JValueToJBoolean(v C.jvalue) C.jboolean

func JValueToJByte

func JValueToJByte(v C.jvalue) C.jbyte

func JValueToJChar

func JValueToJChar(v C.jvalue) C.jchar

func JValueToJDouble

func JValueToJDouble(v C.jvalue) C.jdouble

func JValueToJFloat

func JValueToJFloat(v C.jvalue) C.jfloat

func JValueToJInt

func JValueToJInt(v C.jvalue) C.jint

func JValueToJLong

func JValueToJLong(v C.jvalue) C.jlong

func JValueToJObject

func JValueToJObject(v C.jvalue) C.jobject

func JValueToJShort

func JValueToJShort(v C.jvalue) C.jshort

func JavaBoolean

func JavaBoolean(z bool) C.jboolean

func JavaByte

func JavaByte(b int8) C.jbyte

func JavaChar

func JavaChar(c uint16) C.jchar

func JavaDouble

func JavaDouble(d float64) C.jdouble

func JavaFloat

func JavaFloat(f float32) C.jfloat

func JavaIntFor32Bit

func JavaIntFor32Bit(i int) C.jint

func JavaIntFor64Bit

func JavaIntFor64Bit(i int) C.jint

From https://golang.org/ref/spec#Numeric_types:

uint       either 32 or 64 bits
int        same size as uint
uintptr    an unsigned integer large enough to store the
           uninterpreted bits of a pointer value

func JavaIntRaw

func JavaIntRaw(i int32) C.jint

func JavaLong

func JavaLong(j int64) C.jlong

func JavaShort

func JavaShort(s int16) C.jshort

func JavaSize

func JavaSize(i int) C.jsize

func JavaSizeRaw

func JavaSizeRaw(i int32) C.jsize

func MonitorEnter

func MonitorEnter(env *C.JNIEnv, obj C.jobject) C.jint

jni.h:

jint (JNICALL *MonitorEnter)(JNIEnv *env, jobject obj);

func MonitorExit

func MonitorExit(env *C.JNIEnv, obj C.jobject) C.jint

jni.h:

jint (JNICALL *MonitorExit)(JNIEnv *env, jobject obj);

func NewBooleanArray

func NewBooleanArray(env *C.JNIEnv, _len C.jsize) C.jbooleanArray

jni.h:

jbooleanArray (JNICALL *NewBooleanArray)(JNIEnv *env, jsize len);

func NewByteArray

func NewByteArray(env *C.JNIEnv, _len C.jsize) C.jbyteArray

jni.h:

jbyteArray (JNICALL *NewByteArray)(JNIEnv *env, jsize len);

func NewCharArray

func NewCharArray(env *C.JNIEnv, _len C.jsize) C.jcharArray

jni.h:

jcharArray (JNICALL *NewCharArray)(JNIEnv *env, jsize len);

func NewDirectByteBuffer

func NewDirectByteBuffer(env *C.JNIEnv, address unsafe.Pointer, capacity C.jlong) C.jobject

jni.h:

jobject (JNICALL *NewDirectByteBuffer)(JNIEnv* env, void* address, jlong capacity);

func NewDoubleArray

func NewDoubleArray(env *C.JNIEnv, _len C.jsize) C.jdoubleArray

jni.h:

jdoubleArray (JNICALL *NewDoubleArray)(JNIEnv *env, jsize len);

func NewFloatArray

func NewFloatArray(env *C.JNIEnv, _len C.jsize) C.jfloatArray

jni.h:

jfloatArray (JNICALL *NewFloatArray)(JNIEnv *env, jsize len);

func NewGlobalRef

func NewGlobalRef(env *C.JNIEnv, lobj C.jobject) C.jobject

jni.h:

jobject (JNICALL *NewGlobalRef)(JNIEnv *env, jobject lobj);

func NewIntArray

func NewIntArray(env *C.JNIEnv, _len C.jsize) C.jintArray

jni.h:

jintArray (JNICALL *NewIntArray)(JNIEnv *env, jsize len);

func NewLocalRef

func NewLocalRef(env *C.JNIEnv, ref C.jobject) C.jobject

jni.h:

jobject (JNICALL *NewLocalRef)(JNIEnv *env, jobject ref);

func NewLongArray

func NewLongArray(env *C.JNIEnv, _len C.jsize) C.jlongArray

jni.h:

jlongArray (JNICALL *NewLongArray)(JNIEnv *env, jsize len);

func NewObjectA

func NewObjectA(env *C.JNIEnv, clazz C.jclass, methodID C.jmethodID, args *C.jvalue) C.jobject

jni.h:

jobject (JNICALL *NewObject)(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *NewObjectV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jobject (JNICALL *NewObjectA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);

func NewObjectArray

func NewObjectArray(env *C.JNIEnv, _len C.jsize, clazz C.jclass, init C.jobject) C.jobjectArray

jni.h:

jobjectArray (JNICALL *NewObjectArray)(JNIEnv *env, jsize len, jclass clazz, jobject init);

func NewShortArray

func NewShortArray(env *C.JNIEnv, _len C.jsize) C.jshortArray

jni.h:

jshortArray (JNICALL *NewShortArray)(JNIEnv *env, jsize len);

func NewString

func NewString(env *C.JNIEnv, unicode *C.jchar, _len C.jsize) C.jstring

jni.h:

jstring (JNICALL *NewString)(JNIEnv *env, const jchar *unicode, jsize len);

func NewStringUTF

func NewStringUTF(env *C.JNIEnv, utf *C.char) C.jstring

jni.h:

jstring (JNICALL *NewStringUTF)(JNIEnv *env, const char *utf);

func NewWeakGlobalRef

func NewWeakGlobalRef(env *C.JNIEnv, obj C.jobject) C.jweak

jni.h:

jweak (JNICALL *NewWeakGlobalRef)(JNIEnv *env, jobject obj);

func PopLocalFrame

func PopLocalFrame(env *C.JNIEnv, result C.jobject) C.jobject

jni.h:

jobject (JNICALL *PopLocalFrame)(JNIEnv *env, jobject result);

func PushLocalFrame

func PushLocalFrame(env *C.JNIEnv, capacity C.jint) C.jint

jni.h:

jint (JNICALL *PushLocalFrame)(JNIEnv *env, jint capacity);

func RegisterNatives

func RegisterNatives(env *C.JNIEnv, clazz C.jclass, methods *C.JNINativeMethod, nMethods C.jint) C.jint

jni.h:

jint (JNICALL *RegisterNatives)(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, jint nMethods);

func ReleaseBooleanArrayElements

func ReleaseBooleanArrayElements(env *C.JNIEnv, array C.jbooleanArray, elems *C.jboolean, mode C.jint)

jni.h:

void (JNICALL *ReleaseBooleanArrayElements)(JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);

func ReleaseByteArrayElements

func ReleaseByteArrayElements(env *C.JNIEnv, array C.jbyteArray, elems *C.jbyte, mode C.jint)

jni.h:

void (JNICALL *ReleaseByteArrayElements)(JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);

func ReleaseCharArrayElements

func ReleaseCharArrayElements(env *C.JNIEnv, array C.jcharArray, elems *C.jchar, mode C.jint)

jni.h:

void (JNICALL *ReleaseCharArrayElements)(JNIEnv *env, jcharArray array, jchar *elems, jint mode);

func ReleaseDoubleArrayElements

func ReleaseDoubleArrayElements(env *C.JNIEnv, array C.jdoubleArray, elems *C.jdouble, mode C.jint)

jni.h:

void (JNICALL *ReleaseDoubleArrayElements)(JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);

func ReleaseFloatArrayElements

func ReleaseFloatArrayElements(env *C.JNIEnv, array C.jfloatArray, elems *C.jfloat, mode C.jint)

jni.h:

void (JNICALL *ReleaseFloatArrayElements)(JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);

func ReleaseIntArrayElements

func ReleaseIntArrayElements(env *C.JNIEnv, array C.jintArray, elems *C.jint, mode C.jint)

jni.h:

void (JNICALL *ReleaseIntArrayElements)(JNIEnv *env, jintArray array, jint *elems, jint mode);

func ReleaseLongArrayElements

func ReleaseLongArrayElements(env *C.JNIEnv, array C.jlongArray, elems *C.jlong, mode C.jint)

jni.h:

void (JNICALL *ReleaseLongArrayElements)(JNIEnv *env, jlongArray array, jlong *elems, jint mode);

func ReleasePrimitiveArrayCritical

func ReleasePrimitiveArrayCritical(env *C.JNIEnv, array C.jarray, carray unsafe.Pointer, mode C.jint)

jni.h:

void (JNICALL *ReleasePrimitiveArrayCritical)(JNIEnv *env, jarray array, void *carray, jint mode);

func ReleaseShortArrayElements

func ReleaseShortArrayElements(env *C.JNIEnv, array C.jshortArray, elems *C.jshort, mode C.jint)

jni.h:

void (JNICALL *ReleaseShortArrayElements)(JNIEnv *env, jshortArray array, jshort *elems, jint mode);

func ReleaseStringChars

func ReleaseStringChars(env *C.JNIEnv, str C.jstring, chars *C.jchar)

jni.h:

void (JNICALL *ReleaseStringChars)(JNIEnv *env, jstring str, const jchar *chars);

func ReleaseStringCritical

func ReleaseStringCritical(env *C.JNIEnv, string C.jstring, cstring *C.jchar)

jni.h:

void (JNICALL *ReleaseStringCritical)(JNIEnv *env, jstring string, const jchar *cstring);

func ReleaseStringUTFChars

func ReleaseStringUTFChars(env *C.JNIEnv, str C.jstring, chars *C.char)

jni.h:

void (JNICALL *ReleaseStringUTFChars)(JNIEnv *env, jstring str, const char* chars);

func SetBooleanArrayRegion

func SetBooleanArrayRegion(env *C.JNIEnv, array C.jbooleanArray, start, l C.jsize, buf *C.jboolean)

jni.h:

void (JNICALL *SetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);

func SetBooleanField

func SetBooleanField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jboolean)

jni.h:

void (JNICALL *SetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);

func SetByteArrayRegion

func SetByteArrayRegion(env *C.JNIEnv, array C.jbyteArray, start, _len C.jsize, buf *C.jbyte)

jni.h:

void (JNICALL *SetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);

func SetByteField

func SetByteField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jbyte)

jni.h:

void (JNICALL *SetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);

func SetCharArrayRegion

func SetCharArrayRegion(env *C.JNIEnv, array C.jcharArray, start, _len C.jsize, buf *C.jchar)

jni.h:

void (JNICALL *SetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);

func SetCharField

func SetCharField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jchar)

jni.h:

void (JNICALL *SetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);

func SetDoubleArrayRegion

func SetDoubleArrayRegion(env *C.JNIEnv, array C.jdoubleArray, start, _len C.jsize, buf *C.jdouble)

jni.h:

void (JNICALL *SetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);

func SetDoubleField

func SetDoubleField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jdouble)

jni.h:

void (JNICALL *SetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);

func SetFloatArrayRegion

func SetFloatArrayRegion(env *C.JNIEnv, array C.jfloatArray, start, _len C.jsize, buf *C.jfloat)

jni.h:

void (JNICALL *SetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);

func SetFloatField

func SetFloatField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jfloat)

jni.h:

void (JNICALL *SetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);

func SetIntArrayRegion

func SetIntArrayRegion(env *C.JNIEnv, array C.jintArray, start, _len C.jsize, buf *C.jint)

jni.h:

void (JNICALL *SetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);

func SetIntField

func SetIntField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jint)

jni.h:

void (JNICALL *SetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID, jint val);

func SetLongArrayRegion

func SetLongArrayRegion(env *C.JNIEnv, array C.jlongArray, start, _len C.jsize, buf *C.jlong)

jni.h:

void (JNICALL *SetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);

func SetLongField

func SetLongField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jlong)

jni.h:

void (JNICALL *SetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);

func SetObjectArrayElement

func SetObjectArrayElement(env *C.JNIEnv, array C.jobjectArray, index C.jsize, val C.jobject)

jni.h:

void (JNICALL *SetObjectArrayElement)(JNIEnv *env, jobjectArray array, jsize index, jobject val);

func SetObjectField

func SetObjectField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jobject)

jni.h:

void (JNICALL *SetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);

func SetShortArrayRegion

func SetShortArrayRegion(env *C.JNIEnv, array C.jshortArray, start, _len C.jsize, buf *C.jshort)

jni.h:

void (JNICALL *SetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);

func SetShortField

func SetShortField(env *C.JNIEnv, obj C.jobject, fieldID C.jfieldID, val C.jshort)

jni.h:

void (JNICALL *SetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);

func SetStaticBooleanField

func SetStaticBooleanField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jboolean)

jni.h:

void (JNICALL *SetStaticBooleanField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);

func SetStaticByteField

func SetStaticByteField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jbyte)

jni.h:

void (JNICALL *SetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);

func SetStaticCharField

func SetStaticCharField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jchar)

jni.h:

void (JNICALL *SetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);

func SetStaticDoubleField

func SetStaticDoubleField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jdouble)

jni.h:

void (JNICALL *SetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);

func SetStaticFloatField

func SetStaticFloatField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jfloat)

jni.h:

void (JNICALL *SetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);

func SetStaticIntField

func SetStaticIntField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jint)

jni.h:

void (JNICALL *SetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);

func SetStaticLongField

func SetStaticLongField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jlong)

jni.h:

void (JNICALL *SetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);

func SetStaticObjectField

func SetStaticObjectField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jobject)

jni.h:

void (JNICALL *SetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);

func SetStaticShortField

func SetStaticShortField(env *C.JNIEnv, clazz C.jclass, fieldID C.jfieldID, value C.jshort)

jni.h:

void (JNICALL *SetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);

func Throw

func Throw(env *C.JNIEnv, obj C.jthrowable) C.jint

jni.h:

jint (JNICALL *Throw)(JNIEnv *env, jthrowable obj);

func ThrowNew

func ThrowNew(env *C.JNIEnv, clazz C.jclass, msg *C.char) C.jint

jni.h:

jint (JNICALL *ThrowNew)(JNIEnv *env, jclass clazz, const char *msg);

func ToReflectedField

func ToReflectedField(env *C.JNIEnv, cls C.jclass, fieldID C.jfieldID, isStatic C.jboolean) C.jobject

jni.h:

jobject (JNICALL *ToReflectedField)(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);

func ToReflectedMethod

func ToReflectedMethod(env *C.JNIEnv, cls C.jclass, methodID C.jmethodID, isStatic C.jboolean) C.jobject

jni.h:

jobject (JNICALL *ToReflectedMethod)(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);

func UnregisterNatives

func UnregisterNatives(env *C.JNIEnv, clazz C.jclass) C.jint

jni.h:

jint (JNICALL *UnregisterNatives)(JNIEnv *env, jclass clazz);

func UnwrapPtrCChar

func UnwrapPtrCChar(f func(unsafe.Pointer)) func(*C.char)

func UnwrapPtrCJValue

func UnwrapPtrCJValue(f func(unsafe.Pointer)) func(*C.jvalue)

func WithCString

func WithCString(s string, f func(*C.char))

For example, see:

src/net/cgo_unix.go
src/os/user/lookup_unix.go

func WithJValueArray

func WithJValueArray(va []C.jvalue, f func(*C.jvalue))

Types

type ClassCircularityError

type ClassCircularityError Throwable

type ClassFormatError

type ClassFormatError Throwable

type JClass

type JClass JObject

jni.h:

typedef jobject jclass;

func GoJClass

func GoJClass(peer C.jclass) JClass

func (JClass) JObjectPeer

func (clazz JClass) JObjectPeer() C.jobject

func (JClass) Peer

func (clazz JClass) Peer() C.jclass

type JFieldID

type JFieldID uintptr

jni.h:

struct _jfieldID;
typedef struct _jfieldID *jfieldID;

func GoJFieldID

func GoJFieldID(peer C.jfieldID) JFieldID

func (JFieldID) Peer

func (fieldID JFieldID) Peer() C.jfieldID

type JMethodID

type JMethodID uintptr

jni.h:

struct _jmethodID;
typedef struct _jmethodID *jmethodID;

func GoJMethodID

func GoJMethodID(peer C.jmethodID) JMethodID

func (JMethodID) Peer

func (methodID JMethodID) Peer() C.jmethodID

type JNIEnv

type JNIEnv uintptr

jni.h:

/*
 * JNI Native Method Interface.
 */

struct JNINativeInterface_;
typedef const struct JNINativeInterface_ *JNIEnv;

func GoJNIEnv

func GoJNIEnv(peer *C.JNIEnv) JNIEnv

func (JNIEnv) AllocObject

func (env JNIEnv) AllocObject(clazz JClass) JObject

func (JNIEnv) CallObjectMethod

func (env JNIEnv) CallObjectMethod(obj JObject, methodID JMethodID, args ...interface{}) JObject

func (JNIEnv) DefineClass

func (env JNIEnv) DefineClass(name string, loader JObject, buf []byte, _len int) (JClass, error)

func (JNIEnv) DeleteGlobalRef

func (env JNIEnv) DeleteGlobalRef(gref JObject)

func (JNIEnv) DeleteLocalRef

func (env JNIEnv) DeleteLocalRef(obj JObject)

func (JNIEnv) EnsureLocalCapacity

func (env JNIEnv) EnsureLocalCapacity(capacity int) int

func (JNIEnv) ExceptionCheck

func (env JNIEnv) ExceptionCheck() bool

func (JNIEnv) ExceptionClear

func (env JNIEnv) ExceptionClear()

func (JNIEnv) ExceptionDescribe

func (env JNIEnv) ExceptionDescribe()

func (JNIEnv) ExceptionOccurred

func (env JNIEnv) ExceptionOccurred() JThrowable

func (JNIEnv) FatalError

func (env JNIEnv) FatalError(msg string)

func (JNIEnv) FindClass

func (env JNIEnv) FindClass(name string) JClass

func (JNIEnv) FromReflectedField

func (env JNIEnv) FromReflectedField(field JObject) JFieldID

func (JNIEnv) FromReflectedMethod

func (env JNIEnv) FromReflectedMethod(method JObject) JMethodID

func (JNIEnv) GetMethodID

func (env JNIEnv) GetMethodID(clazz JClass, name, sig string) JMethodID

func (JNIEnv) GetObjectClass

func (env JNIEnv) GetObjectClass(obj JObject) JClass

func (JNIEnv) GetStringChars

func (env JNIEnv) GetStringChars(str JString) (chars []uint16, isCopy bool, err error)

GetStringChars is a middle-level API. Use JString.WithChars{,E} from jstring.go for general purposes.

func (JNIEnv) GetStringCritical

func (env JNIEnv) GetStringCritical(str JString) (cstring []uint16, isCopy bool, err error)

ReleaseStringUTFChars is a middle-level API.

func (JNIEnv) GetStringLength

func (env JNIEnv) GetStringLength(str JString) int

GetStringLength is a middle-level API. Use JString.Len{,E} from jstring.go for general purposes.

func (JNIEnv) GetStringRegion

func (env JNIEnv) GetStringRegion(str JString, start, _len int, buf []uint16) error

ReleaseStringUTFChars is a middle-level API.

func (JNIEnv) GetStringUTFChars

func (env JNIEnv) GetStringUTFChars(str JString) (chars []byte, isCopy bool, err error)

GetStringUTFChars is a middle-level API. Use JString.WithUTFChars{,E} from jstring.go for general purposes.

func (JNIEnv) GetStringUTFLength

func (env JNIEnv) GetStringUTFLength(str JString) int

GetStringUTFLength is a middle-level API. Use JString.UTFLen{,E} from jstring.go for general purposes.

func (JNIEnv) GetStringUTFRegion

func (env JNIEnv) GetStringUTFRegion(str JString, start, _len int, buf []byte) error

ReleaseStringUTFChars is a middle-level API.

func (JNIEnv) GetSuperclass

func (env JNIEnv) GetSuperclass(sub JClass) JClass

func (JNIEnv) GetVersion

func (env JNIEnv) GetVersion() (Version, error)

func (JNIEnv) IsAssignableFrom

func (env JNIEnv) IsAssignableFrom(sub, sup JClass) bool

func (JNIEnv) IsInstanceOf

func (env JNIEnv) IsInstanceOf(obj JObject, clazz JClass) bool

func (JNIEnv) IsSameObject

func (env JNIEnv) IsSameObject(obj1, obj2 JObject) bool

func (JNIEnv) NewGlobalRef

func (env JNIEnv) NewGlobalRef(lobj JObject) JObject

func (JNIEnv) NewLocalRef

func (env JNIEnv) NewLocalRef(ref JObject) JObject

func (JNIEnv) NewObject

func (env JNIEnv) NewObject(clazz JClass, methodID JMethodID, args ...interface{}) JObject

func (JNIEnv) NewString

func (env JNIEnv) NewString(s string) (str JString, err error)

NewString is a middle-level API. Use JStringFromGoString{,E} from jstring.go for general purposes.

func (JNIEnv) NewStringUTF

func (env JNIEnv) NewStringUTF(s string) (str JString, err error)

NewStringUTF is a middle-level API. In JNI, this function allows the caller to provide a "modified UTF-8" buffer, instead of a UTF-16 buffer as in NewString. However, this makes no difference in this wrapper, since the parameter type is a Go string. As a result, this duplicats the functionality of NewString. This function exists for completeness only. Use JStringFromGoString{,E} from jstring.go for general purposes.

func (JNIEnv) Peer

func (env JNIEnv) Peer() *C.JNIEnv

func (JNIEnv) PopLocalFrame

func (env JNIEnv) PopLocalFrame(result JObject) JObject

func (JNIEnv) PushLocalFrame

func (env JNIEnv) PushLocalFrame(capacity int) int

func (JNIEnv) ReleaseStringChars

func (env JNIEnv) ReleaseStringChars(str JString, chars []uint16)

ReleaseStringChars is a middle-level API. Use JString.WithChars{,E} from jstring.go for general purposes.

func (JNIEnv) ReleaseStringCritical

func (env JNIEnv) ReleaseStringCritical(str JString, cstring []uint16)

ReleaseStringUTFChars is a middle-level API.

func (JNIEnv) ReleaseStringUTFChars

func (env JNIEnv) ReleaseStringUTFChars(str JString, chars []byte)

ReleaseStringUTFChars is a middle-level API. Use JString.WithUTFChars{,E} from jstring.go for general purposes.

func (JNIEnv) Throw

func (env JNIEnv) Throw(obj JThrowable) int

func (JNIEnv) ThrowNew

func (env JNIEnv) ThrowNew(clazz JClass, msg string) int

func (JNIEnv) ToReflectedField

func (env JNIEnv) ToReflectedField(cls JClass, fieldID JFieldID, isStatic bool) JObject

func (JNIEnv) ToReflectedMethod

func (env JNIEnv) ToReflectedMethod(cls JClass, methodID JMethodID, isStatic bool) JObject

type JObject

type JObject uintptr

jni.h:

struct _jobject;
typedef struct _jobject *jobject;

func GoJObject

func GoJObject(peer C.jobject) JObject

func (JObject) JObjectPeer

func (obj JObject) JObjectPeer() C.jobject

func (JObject) Peer

func (obj JObject) Peer() C.jobject

type JString

type JString JObject

jni.h:

typedef jobject jstring;

func GoJString

func GoJString(peer C.jstring) JString

func JStringFromGoString

func JStringFromGoString(s string) (str JString, err error)

JStringFromGoString creates a JString from a Go string. It is the high-level API for the NewString JNI function. errors: NilReturnValueError, OutOfMemoryError

func JStringFromGoStringE

func JStringFromGoStringE(s string, env JNIEnv) (str JString, err error)

JStringFromGoStringE is like JStringFromGoString, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv. errors: NilReturnValueError, OutOfMemoryError

func (JString) JObjectPeer

func (str JString) JObjectPeer() C.jobject

func (JString) ModifiedUTF8Len

func (str JString) ModifiedUTF8Len() int

ModifiedUTF8Len returns the length of the JString in number of "modified UTF-8" characters. It is the high-level API for the GetStringUTFLength JNI function.

func (JString) ModifiedUTF8LenE

func (str JString) ModifiedUTF8LenE(env JNIEnv) int

ModifiedUTF8LenE is like ModifiedUTF8Len, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv.

func (JString) ModifiedUTF8Region

func (str JString) ModifiedUTF8Region(start, length int, buf []byte) error

TODO: Doc errors: StringIndexOutOfBoundsException

func (JString) ModifiedUTF8RegionE

func (str JString) ModifiedUTF8RegionE(start, length int, buf []byte, env JNIEnv) error

TODO: Doc errors: StringIndexOutOfBoundsException

func (JString) Peer

func (str JString) Peer() C.jstring

func (JString) String

func (str JString) String() string

String creates a Go string from a JString. It implements the fmt.Stringer interface. It calls StringRaw for the actual work. If the returned "err" field is not nil, it panics.

func (JString) StringE

func (str JString) StringE(env JNIEnv) string

StringE is like String, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv.

func (JString) StringRaw

func (str JString) StringRaw() (s string, err error)

StringRaw creates a Go string from a JString. errors:

func (JString) StringRawE

func (str JString) StringRawE(env JNIEnv) (s string, err error)

StringRawE is like StringRaw, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv. errors:

func (JString) UTF16Len

func (str JString) UTF16Len() int

UTF16Len returns the length of the JString in number of UTF-16 characters. It is the high-level API for the GetStringLength JNI function.

func (JString) UTF16LenE

func (str JString) UTF16LenE(env JNIEnv) int

UTF16LenE is like UTF16Len, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv.

func (JString) UTF16Region

func (str JString) UTF16Region(start, length int, buf []uint16) error

TODO: Doc errors: StringIndexOutOfBoundsException

func (JString) UTF16RegionE

func (str JString) UTF16RegionE(start, length int, buf []uint16, env JNIEnv) error

TODO: Doc errors: StringIndexOutOfBoundsException

func (JString) WithModifiedUTF8Bytes

func (str JString) WithModifiedUTF8Bytes(consumer func(bytes []byte, isCopy bool)) error

WithModifiedUTF8Bytes lets the caller to work with the "modified UTF-8" characters contained in the JString. It is the high-level API for the GetStringUTFChars and ReleaseStringUTFChars JNI functions. In the callback function (consumer), "chars" is the slice containing the "modified UTF-8" characters, and "isCopy" indicates whether a copy of the C array is made by the JVM, or the underlying C array of the Java String is returned directly. "chars" points directly to whatever value the underlying call returns, so if "isCopy" is false, the caller MUST NOT modify any element in "chars". errors: NilReturnValueError

func (JString) WithModifiedUTF8BytesE

func (str JString) WithModifiedUTF8BytesE(consumer func(bytes []byte, isCopy bool), env JNIEnv) error

WithModifiedUTF8BytesE is like WithModifiedUTF8Bytes, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv. errors: NilReturnValueError

func (JString) WithUTF16Chars

func (str JString) WithUTF16Chars(consumer func(chars []uint16, isCopy bool)) error

WithUTF16Chars lets the caller to work with the UTF-16 characters contained in the JString. It is the high-level API for the GetStringChars and ReleaseStringChars JNI functions. In the callback function (consumer), "chars" is the slice containing the UTF-16 characters, and "isCopy" indicates whether a copy of the C array is made by the JVM, or the underlying C array of the Java String is returned directly. "chars" points directly to whatever value the underlying call returns, so if "isCopy" is false, the caller MUST NOT modify any element in "chars". errors: NilReturnValueError

func (JString) WithUTF16CharsCritical

func (str JString) WithUTF16CharsCritical(consumer func(chars []uint16, isCopy bool)) error

TODO: Doc errors: NilReturnValueError

func (JString) WithUTF16CharsCriticalE

func (str JString) WithUTF16CharsCriticalE(consumer func(chars []uint16, isCopy bool), env JNIEnv) error

TODO: Doc errors: NilReturnValueError

func (JString) WithUTF16CharsE

func (str JString) WithUTF16CharsE(consumer func(chars []uint16, isCopy bool), env JNIEnv) error

WithUTF16CharsE is like WithUTF16Chars, but it accepts a custom JNIEnv. It calls the underlying functions with the provided JNIEnv. errors: NilReturnValueError

type JThrowable

type JThrowable JObject

jni.h:

typedef jobject jthrowable;

func GoJThrowable

func GoJThrowable(peer C.jthrowable) JThrowable

func (JThrowable) GetMessage

func (t JThrowable) GetMessage() string

This must be implemented with low level API, since JNIEnv.CallObjectMethod() calls this method

func (JThrowable) JObjectPeer

func (throw JThrowable) JObjectPeer() C.jobject

func (JThrowable) Peer

func (throw JThrowable) Peer() C.jthrowable

type JWeak

type JWeak JObject

jni.h:

typedef jobject jweak;

func GoJWeak

func GoJWeak(peer C.jweak) JWeak

func (JWeak) JObjectPeer

func (weak JWeak) JObjectPeer() C.jobject

func (JWeak) Peer

func (weak JWeak) Peer() C.jweak

type JavaVM

type JavaVM uintptr

jni.h:

/*
 * JNI Invocation Interface.
 */

struct JNIInvokeInterface_;
typedef const struct JNIInvokeInterface_ *JavaVM;

func GoJavaVM

func GoJavaVM(peer *C.JavaVM) JavaVM

func (JavaVM) Peer

func (vm JavaVM) Peer() *C.JavaVM

type OutOfMemoryError

type OutOfMemoryError Throwable

type SecurityException

type SecurityException Throwable

type Throwable

type Throwable struct {
	// contains filtered or unexported fields
}

func ToThrowable

func ToThrowable(t JThrowable) Throwable

func (Throwable) Error

func (t Throwable) Error() string

Implements the built-in "error" interface See: https://golang.org/ref/spec#Errors

type Version

type Version int32

jni.h:

#define JNI_VERSION_1_1 0x00010001
#define JNI_VERSION_1_2 0x00010002
#define JNI_VERSION_1_4 0x00010004
#define JNI_VERSION_1_6 0x00010006
#define JNI_VERSION_1_8 0x00010008
const (
	// To prevent the values from not being defined in C side,
	// actual values are used.
	JNI_VERSION_1_1 Version = iota + 0x00010001
	JNI_VERSION_1_2

	JNI_VERSION_1_4

	JNI_VERSION_1_6

	JNI_VERSION_1_8
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL