本文整理汇总了C#中MonoJavaBridge.JniHandle类的典型用法代码示例。如果您正苦于以下问题:C# JniHandle类的具体用法?C# JniHandle怎么用?C# JniHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JniHandle类属于MonoJavaBridge命名空间,在下文中一共展示了JniHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unregister
public static unsafe void Unregister(JniHandle clazz, JNIEnv env)
{
JNIResult res = env.UnregisterNatives(clazz);
if (res != JNIResult.JNI_OK)
{
throw new JNIException("Can't unbind native methods to class.");
}
}
示例2: SetBooleanArrayRegion
public void SetBooleanArrayRegion(JniHandle array, int start, int len, bool[] buf)
{
fixed (bool* ptr = &buf[0])
{
setBooleanArrayRegion(envPtr, array, start, len, (byte*) ptr);
}
ExceptionTest();
}
示例3: SetByteArrayRegion
public void SetByteArrayRegion(JniHandle array, int start, int len, byte[] buf)
{
fixed (byte* ptr = &buf[0])
{
setByteArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例4: SetCharArrayRegion
public void SetCharArrayRegion(JniHandle array, int start, int len, char[] buf)
{
fixed (char* ptr = &buf[0])
{
setCharArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例5: SetFloatArrayRegion
public void SetFloatArrayRegion(JniHandle array, int start, int len, float[] buf)
{
fixed (float* ptr = &buf[0])
{
setFloatArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例6: SetLongArrayRegion
public void SetLongArrayRegion(JniHandle array, int start, int len, long[] buf)
{
fixed (long* ptr = &buf[0])
{
setLongArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例7: Register
public static unsafe void Register(List<JNINativeMethod> registrations, JniHandle clazz, JNIEnv env)
{
JNINativeMethod[] methods = registrations.ToArray();
JNIResult res = env.RegisterNatives(clazz, methods, methods.Length);
if (res!=JNIResult.JNI_OK)
{
throw new JNIException("Can't bind native methods to class. Is it in system classloader?");
}
}
示例8: GetArrayLength
public int GetArrayLength(JniHandle array)
{
int res = getArrayLength(envPtr, array);
ExceptionTest();
return res;
}
示例9: SetObjectArrayElement
public void SetObjectArrayElement(JniHandle array, int index, JniHandle val)
{
setObjectArrayElement(envPtr, array, index, val);
ExceptionTest();
}
示例10: GetShortArrayRegion
public void GetShortArrayRegion(JniHandle array, int start, int len, short[] buf)
{
fixed (short* ptr = &buf[0])
{
getShortArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例11: GetDoubleArrayRegion
public void GetDoubleArrayRegion(JniHandle array, int start, int len, double[] buf)
{
fixed (double* ptr = &buf[0])
{
getDoubleArrayRegion(envPtr, array, start, len, ptr);
}
ExceptionTest();
}
示例12: Throw
internal void Throw(JniHandle ptr)
{
if (@throw(envPtr, ptr) != JNIResult.JNI_OK)
{
throw new JNIException("Can't throw");
}
}
示例13: NewObjectArray
public JniLocalHandle NewObjectArray(int len, JniHandle clazz, JniHandle init)
{
JniLocalHandle res = newObjectArray(envPtr, len, clazz, init);
ExceptionTest();
return res;
}
示例14: SetStaticDoubleField
internal void SetStaticDoubleField(JniHandle clazz, FieldId fieldID, double value)
{
setStaticDoubleField(envPtr, clazz, fieldID.native, value);
ExceptionTest();
}
示例15: CallDoubleMethod
public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
{
double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args);
ExceptionTest();
return res;
}