diff --git a/README.md b/README.md index e2864dd9d..4e504df41 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ If you fail to re-install the runtime package, then `jar` will fail to run: ## Type Safety -The start of the reboot is to use strongly typed [`SafeHandle`][SafeHandle] +The start of the reboot was to use strongly typed [`SafeHandle`][SafeHandle] subclasses everywhere instead of `IntPtr`. This allows a local reference to be type-checked and distinct from a global ref, complete with compiler type checking. @@ -76,6 +76,72 @@ type checking. Since we now have actual types in more places, we can move the current `JNIEnv` methods into more semantically meaningful types. +Unfortunately, various tests demonstrated that while `SafeHandle`s provided +increased type safety, they did so at a large runtime cost: + +1. `SafeHandle`s are reference types, increasing GC heap allocations and pressure. +2. [`SafeHandle`s are *thread-safe* in order to prevent race conditions and handle recycling attacks][reliability]. + +[reliability]: http://blogs.msdn.com/b/bclteam/archive/2005/03/16/396900.aspx + +Compared to a Xamarin.Android-like "use `IntPtr`s for *everything*" binding +approach, the overhread is significant: to *just* invoke +`JNIEnv::CallObjectMethod()`, using `SafeHandle`s for everything causes +execution time to take ~1.4x longer than a comparable struct-oriented approach. + +Make the test more realistic -- compared to current Xamarin.Android and +current Java.Interop -- so that `JniEnvironment.Members.CallObjectMethod()` +also calls `JniEnvironment.Errors.ExceptionOccurred()`, which also returns +a JNI local reference -- and runtime execution time *jumped to ~3.6x*: + + # SafeHandle timing: 00:00:09.9393493 + # Average Invocation: 0.00099393493ms + # JniObjectReference timing: 00:00:02.7254572 + # Average Invocation: 0.00027254572ms + +(See the [tests/invocation-overhead](tests/invocation-overhead) directory +for the invocation comparison sourcecode.) + +*This is not acceptable*. Performance is a known issue with Xamarin.Android; +we can't be making it *worse*. + +Meanwhile, I *really* dislike using `IntPtr`s everywhere, as it doesn't let you +know what the value actually represents. + +To solve this issue, *avoid `SafeHandle` types* in the public API. + +Downside: this means we can't have the GC collect our garbage JNI references. + +Upside: the Java.Interop effort will actually be usable. + +Instead of using `SafeHandle` types, we introduce a +`JniObjectReference` struct type. This represents a JNI Local, Global, or +WeakGlobal object reference. The `JniObjectReference` struct also contains +the *reference type* as `JniObjectReferenceType`, formerly `JniReferenceType`. +`jmethodID` and `jfieldID` become "normal" class types, permitting type safety, +but lose their `SafeHandle` status, which was never really necessary because +they don't require cleanup *anyway*. Furthermore, these values should be +*cached* -- see `JniPeerMembers` -- so making them GC objects shouldn't be +a long-term problem. + +By doing so, we allow Java.Interop to have *two separate implementations*, +controlled by build-time `#define`s: + +* `FEATURE_HANDLES_ARE_SAFE_HANDLES`: Causes `JniObjectReference` to + contain a `SafeHandle` wrapping the underlying JNI handle. +* `FEATURE_HANDLES_ARE_INTPTRS`: Causes `JniObjectReference` to contain + an `IntPtr` for the underlying JNI handle. + +The rationale for this is twofold: + +1. It allows swapping out "safer" `SafeHandle` and "less safe" `IntPtr` + implementations, permitting easier performance comparisons. +2. It allows migrating the existing code, as some of the existing + tests may assume that JNI handles are garbage collected, which + won't be the case when `FEATURE_HANDLES_ARE_INTPTRS` is set. + +`FEATURE_HANDLES_ARE_INTPTRS` support is still in-progresss. + ## Naming Conventions Types with a `Java` prefix are "high-level" types which participate in cross-VM diff --git a/samples/Hello/Program.cs b/samples/Hello/Program.cs index 062e287ee..e4e4bdab2 100644 --- a/samples/Hello/Program.cs +++ b/samples/Hello/Program.cs @@ -21,7 +21,7 @@ public static unsafe void Main (string[] args) Console.WriteLine ("Part 2!"); using (var vm = new JreVMBuilder ().CreateJreVM ()) { Console.WriteLine ("# JniEnvironment.Current={0}", JniEnvironment.Current); - Console.WriteLine ("vm.SafeHandle={0}", vm.SafeHandle); + Console.WriteLine ("vm.SafeHandle={0}", vm.InvocationPointer); var t = new JniType ("java/lang/Object"); var c = t.GetConstructor ("()V"); var o = t.NewObject (c, null); @@ -29,7 +29,7 @@ public static unsafe void Main (string[] args) int i = m.CallVirtualInt32Method (o); Console.WriteLine ("java.lang.Object={0}", o); Console.WriteLine ("hashcode={0}", i); - o.Dispose (); + JniEnvironment.Handles.Dispose (ref o); t.Dispose (); // var o = JniTypes.FindClass ("java/lang/Object"); /* diff --git a/src/Android.Interop/Java.Interop/AndroidVM.cs b/src/Android.Interop/Java.Interop/AndroidVM.cs index 6eb529a41..c6ff6c602 100644 --- a/src/Android.Interop/Java.Interop/AndroidVM.cs +++ b/src/Android.Interop/Java.Interop/AndroidVM.cs @@ -6,21 +6,21 @@ namespace Java.Interop { // FOR TEST PURPOSES ONLY - public delegate JniLocalReference SafeHandleDelegate_CallObjectMethodA (JniEnvironmentSafeHandle env, JniReferenceSafeHandle instance, JniInstanceMethodID method, JValue[] args); - public delegate void SafeHandleDelegate_DeleteLocalRef (JniEnvironmentSafeHandle env, IntPtr handle); + public delegate IntPtr SafeHandleDelegate_CallObjectMethodA (IntPtr env, IntPtr instance, IntPtr method, JValue[] args); + public delegate void SafeHandleDelegate_DeleteLocalRef (IntPtr env, IntPtr handle); class AndroidVMBuilder : JavaVMOptions { public AndroidVMBuilder () { - EnvironmentHandle = new JniEnvironmentSafeHandle (JNIEnv.Handle); + EnvironmentPointer = JNIEnv.Handle; NewObjectRequired = ((int) Android.OS.Build.VERSION.SdkInt) <= 10; using (var env = new JniEnvironment (JNIEnv.Handle)) { - JavaVMSafeHandle vm; + IntPtr vm; int r = JniEnvironment.Handles.GetJavaVM (out vm); if (r < 0) throw new InvalidOperationException ("JNIEnv::GetJavaVM() returned: " + r); - VMHandle = vm; + InvocationPointer = vm; } JniHandleManager = Java.InteropTests.LoggingJniHandleManagerDecorator.GetHandleManager (new JniHandleManager ()); } @@ -44,18 +44,16 @@ internal AndroidVM (AndroidVMBuilder builder) get {return current;} } - protected override bool TryGC (IJavaObject value, ref JniReferenceSafeHandle handle) + protected override bool TryGC (IJavaObject value, ref JniObjectReference handle) { - System.Diagnostics.Debug.WriteLine ("# AndroidVM.TryGC"); - if (handle == null || handle.IsInvalid) + if (!handle.IsValid) return true; var wgref = handle.NewWeakGlobalRef (); - System.Diagnostics.Debug.WriteLine ("# AndroidVM.TryGC: wgref=0x{0}", wgref.DangerousGetHandle().ToString ("x"));; - handle.Dispose (); + JniEnvironment.Handles.Dispose (ref handle); Java.Lang.Runtime.GetRuntime ().Gc (); handle = wgref.NewGlobalRef (); - System.Diagnostics.Debug.WriteLine ("# AndroidVM.TryGC: handle.IsInvalid={0}", handle.IsInvalid); - return handle == null || handle.IsInvalid; + JniEnvironment.Handles.Dispose (ref wgref); + return handle.IsValid; } Dictionary typeMappings = new Dictionary (); diff --git a/src/Android.Interop/Tests/TestsSample.cs b/src/Android.Interop/Tests/TestsSample.cs index dba45d077..254584d24 100644 --- a/src/Android.Interop/Tests/TestsSample.cs +++ b/src/Android.Interop/Tests/TestsSample.cs @@ -48,17 +48,19 @@ TimeSpan GetXAMethodCallTiming () unsafe TimeSpan GetJIMethodCallTiming () { - using (var k = new JniType ("java/lang/Object")) - using (var c = k.GetConstructor ("()V")) - using (var o = k.NewObject (c, null)) - using (var t = k.GetInstanceMethod ("toString", "()Ljava/lang/String;")) { + using (var k = new JniType ("java/lang/Object")) { + var c = k.GetConstructor ("()V"); + var o = k.NewObject (c, null); + var t = k.GetInstanceMethod ("toString", "()Ljava/lang/String;"); var sw = Stopwatch.StartNew (); for (int i = 0; i < Unified_ToString_Iterations; ++i) { - using (var r = t.CallVirtualObjectMethod (o)) { - } + var r = t.CallVirtualObjectMethod (o); + JniEnvironment.Handles.Dispose (ref r); } sw.Stop (); + + JniEnvironment.Handles.Dispose (ref o); return sw.Elapsed; } } @@ -98,15 +100,15 @@ unsafe void GetJICallObjectMethodAndDeleteLocalRefTimings ( out TimeSpan unsafeCallObjectMethodTime, out TimeSpan unsafeDeleteLocalRefTime) { - using (var k = new JniType ("java/lang/Object")) - using (var c = k.GetConstructor ("()V")) - using (var o = k.NewObject (c, null)) - using (var t = k.GetInstanceMethod ("toString", "()Ljava/lang/String;")) { + using (var k = new JniType ("java/lang/Object")) { + var c = k.GetConstructor ("()V"); + var o = k.NewObject (c, null); + var t = k.GetInstanceMethod ("toString", "()Ljava/lang/String;"); - using (var r = t.CallVirtualObjectMethod (o)) { - } + var r = t.CallVirtualObjectMethod (o); + JniEnvironment.Handles.Dispose (ref r); - var rs = new JniLocalReference [MaxLocalRefs]; + var rs = new JniObjectReference [MaxLocalRefs]; var sw = Stopwatch.StartNew (); for (int i = 0; i < rs.Length; ++i) { @@ -117,7 +119,7 @@ unsafe void GetJICallObjectMethodAndDeleteLocalRefTimings ( sw.Restart (); for (int i = 0; i < rs.Length; ++i) { - rs [i].Dispose (); + JniEnvironment.Handles.Dispose (ref rs [i]); } sw.Stop (); disposeTime = sw.Elapsed; @@ -134,28 +136,27 @@ unsafe void GetJICallObjectMethodAndDeleteLocalRefTimings ( var usafeDel = (IntPtrDelegate_DeleteLocalRef) Marshal.GetDelegateForFunctionPointer (JNIEnv_DeleteLocalRef, typeof (IntPtrDelegate_DeleteLocalRef)); - var sh = JniEnvironment.Current.SafeHandle; - var uh = sh.DangerousGetHandle (); + var uh = JniEnvironment.Current.EnvironmentPointer; var args = new JValue [0]; sw.Restart (); for (int i = 0; i < rs.Length; ++i) { - rs [i] = safeCall (sh, o, t, args); + rs [i] = new JniObjectReference (safeCall (uh, o.Handle, t.ID, args), JniObjectReferenceType.Local); } sw.Stop (); safeCallObjectMethodTime = sw.Elapsed; sw.Restart (); for (int i = 0; i < rs.Length; ++i) { - safeDel (sh, rs [i].DangerousGetHandle ()); - rs [i].SetHandleAsInvalid (); + safeDel (uh, rs [i].Handle); + rs [i] = new JniObjectReference (); } sw.Stop (); safeDeleteLocalRefTime = sw.Elapsed; var urs = new IntPtr [MaxLocalRefs]; - var ut = t.DangerousGetHandle (); - var uo = o.DangerousGetHandle (); + var ut = t.ID; + var uo = o.Handle; sw.Restart (); for (int i = 0; i < urs.Length; ++i) { diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs index 71d25ae8a..b1b1b2ba5 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaClass.cs @@ -85,9 +85,9 @@ protected override bool Disposed { get {return klass.disposed;} } - protected override JniReferenceSafeHandle ConversionTarget { + protected override JniObjectReference ConversionTarget { get { - return klass.info.Members.JniPeerType.SafeHandle; + return klass.info.Members.JniPeerType.PeerReference; } } @@ -139,15 +139,15 @@ static class JavaModifiers { static JavaModifiers () { using (var t = new JniType ("java/lang/reflect/Modifier")) { - using (var s = t.GetStaticField ("STATIC", "I")) - Static = s.GetInt32Value (t.SafeHandle); + var s = t.GetStaticField ("STATIC", "I"); + Static = s.GetInt32Value (t.PeerReference); } } } struct JniArgumentMarshalInfo { JValue jvalue; - JniLocalReference lref; + JniObjectReference lref; IJavaObject obj; Action cleanup; @@ -177,8 +177,7 @@ public void Cleanup (object value) { if (cleanup != null && obj != null) cleanup (obj, value); - if (lref != null) - lref.Dispose (); + JniEnvironment.Handles.Dispose (ref lref); } } } diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaInstance.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaInstance.cs index d2bb6dfa2..b6afee274 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaInstance.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/DynamicJavaInstance.cs @@ -25,7 +25,7 @@ public DynamicJavaInstance (IJavaObject value) Value = value; - var type = JniEnvironment.Types.GetJniTypeNameFromInstance (value.SafeHandle); + var type = JniEnvironment.Types.GetJniTypeNameFromInstance (value.PeerReference); klass = JavaClassInfo.GetClassInfo (type); } @@ -78,9 +78,9 @@ protected override bool Disposed { get {return instance.disposed;} } - protected override JniReferenceSafeHandle ConversionTarget { + protected override JniObjectReference ConversionTarget { get { - return instance.Value.SafeHandle; + return instance.Value.PeerReference; } } diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaClassInfo.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaClassInfo.cs index 98e7b45dc..698ab8197 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaClassInfo.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaClassInfo.cs @@ -163,12 +163,12 @@ public void Dispose () } } - internal static JniReferenceSafeHandle GetMethodParameters (JniReferenceSafeHandle method) + internal static JniObjectReference GetMethodParameters (JniObjectReference method) { return Method_getParameterTypes.CallVirtualObjectMethod (method); } - internal static JniReferenceSafeHandle GetConstructorParameters (JniReferenceSafeHandle method) + internal static JniObjectReference GetConstructorParameters (JniObjectReference method) { return Constructor_getParameterTypes.CallVirtualObjectMethod (method); } @@ -184,14 +184,17 @@ List LookupConstructors () constructors = new List (); - using (var ctors = Class_getConstructors.CallVirtualObjectMethod (Members.JniPeerType.SafeHandle)) { + var ctors = Class_getConstructors.CallVirtualObjectMethod (Members.JniPeerType.PeerReference); + try { int len = JniEnvironment.Arrays.GetArrayLength (ctors); for (int i = 0; i < len; ++i) { var ctor = JniEnvironment.Arrays.GetObjectArrayElement (ctors, i); var m = new JavaConstructorInfo (Members, ctor); constructors.Add (m); - ctor.Dispose (); + JniEnvironment.Handles.Dispose (ref ctor); } + } finally { + JniEnvironment.Handles.Dispose (ref ctors); } return constructors; @@ -204,29 +207,34 @@ Dictionary> LookupFields () return null; lock (Members) { - if (fields != null || Disposed) + if (this.fields != null || Disposed) return this.fields; this.fields = new Dictionary> (); - using (var fields = Class_getFields.CallVirtualObjectMethod (Members.JniPeerType.SafeHandle)) { + var fields = Class_getFields.CallVirtualObjectMethod (Members.JniPeerType.PeerReference); + try { int len = JniEnvironment.Arrays.GetArrayLength (fields); for (int i = 0; i < len; ++i) { var field = JniEnvironment.Arrays.GetObjectArrayElement (fields, i); - var name = JniEnvironment.Strings.ToString (Field_getName.CallVirtualObjectMethod (field), JniHandleOwnership.Transfer); + var n_name = Field_getName.CallVirtualObjectMethod (field); + var name = JniEnvironment.Strings.ToString (ref n_name, JniHandleOwnership.Transfer); var isStatic = IsStatic (field); List overloads; if (!Fields.TryGetValue (name, out overloads)) Fields.Add (name, overloads = new List ()); - using (var type = new JniType (Field_getType.CallVirtualObjectMethod (field), JniHandleOwnership.Transfer)) { + var n_type = Field_getType.CallVirtualObjectMethod (field); + using (var type = new JniType (ref n_type, JniHandleOwnership.Transfer)) { var info = JniEnvironment.Current.JavaVM.GetJniTypeInfoForJniTypeReference (type.Name); overloads.Add (new JavaFieldInfo (Members, name + "\u0000" + info.JniTypeReference, isStatic)); } - field.Dispose (); + JniEnvironment.Handles.Dispose (ref field); } + } finally { + JniEnvironment.Handles.Dispose (ref fields); } return this.fields; @@ -239,36 +247,41 @@ Dictionary> LookupMethods () return null; lock (Members) { - if (methods != null || Disposed) + if (this.methods != null || Disposed) return this.methods; this.methods = new Dictionary> (); - using (var methods = Class_getMethods.CallVirtualObjectMethod (Members.JniPeerType.SafeHandle)) { + var methods = Class_getMethods.CallVirtualObjectMethod (Members.JniPeerType.PeerReference); + try { int len = JniEnvironment.Arrays.GetArrayLength (methods); for (int i = 0; i < len; ++i) { var method = JniEnvironment.Arrays.GetObjectArrayElement (methods, i); - var name = JniEnvironment.Strings.ToString (Method_getName.CallVirtualObjectMethod (method), JniHandleOwnership.Transfer); + var n_name = Method_getName.CallVirtualObjectMethod (method); + var name = JniEnvironment.Strings.ToString (ref n_name, JniHandleOwnership.Transfer); var isStatic = IsStatic (method); List overloads; if (!Methods.TryGetValue (name, out overloads)) Methods.Add (name, overloads = new List ()); - var rt = new JniType (Method_getReturnType.CallVirtualObjectMethod (method), JniHandleOwnership.Transfer); + var nrt = Method_getReturnType.CallVirtualObjectMethod (method); + var rt = new JniType (ref nrt, JniHandleOwnership.Transfer); var m = new JavaMethodInfo (Members, method, name, isStatic) { ReturnType = rt, }; overloads.Add (m); - method.Dispose (); + JniEnvironment.Handles.Dispose (ref method); } + } finally { + JniEnvironment.Handles.Dispose (ref methods); } return this.methods; } } - static bool IsStatic (JniReferenceSafeHandle member) + static bool IsStatic (JniObjectReference member) { var s = Member_getModifiers.CallVirtualInt32Method (member); diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs index 61f31c74c..ff4f1430f 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaConstructorInfo.cs @@ -17,7 +17,7 @@ namespace Java.Interop.Dynamic { class JavaConstructorInfo : JavaMethodBase { - public JavaConstructorInfo (JniPeerMembers members, JniReferenceSafeHandle method) + public JavaConstructorInfo (JniPeerMembers members, JniObjectReference method) : base (members, method) { } @@ -42,7 +42,7 @@ public override unsafe object Invoke (IJavaObject self, JValue* arguments) { if (self == null) { var h = members.InstanceMethods.StartCreateInstance (JniSignature, typeof (JavaInstanceProxy), arguments); - self = JniEnvironment.Current.JavaVM.GetObject (h, JniHandleOwnership.Transfer); + self = JniEnvironment.Current.JavaVM.GetObject (ref h, JniHandleOwnership.Transfer); } members.InstanceMethods.FinishCreateInstance (JniSignature, self, arguments); return new DynamicJavaInstance (self); diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaFieldInfo.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaFieldInfo.cs index 0cfa5056a..fbb3384ae 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaFieldInfo.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaFieldInfo.cs @@ -76,7 +76,7 @@ object GetStaticValue () case 'L': case '[': var lref = members.StaticFields.GetObjectValue (JniSignature); - return ToReturnValue (lref, JniSignature, n + 1); + return ToReturnValue (ref lref, JniSignature, n + 1); default: throw new NotSupportedException ("Unsupported argument type: " + JniSignature.Substring (n + 1)); } @@ -97,7 +97,7 @@ object GetInstanceValue (IJavaObject self) case 'L': case '[': var lref = members.InstanceFields.GetObjectValue (JniSignature, self); - return ToReturnValue (lref, JniSignature, n + 1); + return ToReturnValue (ref lref, JniSignature, n + 1); default: throw new NotSupportedException ("Unsupported argument type: " + JniSignature.Substring (n + 1)); } @@ -137,8 +137,11 @@ void SetStaticValue (object value) case 'D': members.StaticFields.SetValue (JniSignature, (double) value); break; case 'L': case '[': - using (var lref = JniMarshal.CreateLocalRef (value)) { + var lref = JniMarshal.CreateLocalRef (value); + try { members.StaticFields.SetValue (JniSignature, lref); + } finally { + JniEnvironment.Handles.Dispose (ref lref); } return; default: @@ -160,8 +163,11 @@ void SetInstanceValue (IJavaObject self, object value) case 'D': members.InstanceFields.SetValue (JniSignature, self, (double) value); break; case 'L': case '[': - using (var lref = JniMarshal.CreateLocalRef (value)) { + var lref = JniMarshal.CreateLocalRef (value); + try { members.InstanceFields.SetValue (JniSignature, self, lref); + } finally { + JniEnvironment.Handles.Dispose (ref lref); } return; default: diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaInstanceProxy.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaInstanceProxy.cs index c1bf15a31..a780dbf09 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaInstanceProxy.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaInstanceProxy.cs @@ -18,8 +18,8 @@ namespace Java.Interop.Dynamic { [JniTypeInfoAttribute ("java/lang/Object")] class JavaInstanceProxy : JavaObject { - public JavaInstanceProxy (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaInstanceProxy (ref JniObjectReference reference, JniHandleOwnership transfer) + : base (ref reference, transfer) { } } diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs index 318d206e7..9b7e5a686 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMemberInfo.cs @@ -20,9 +20,9 @@ protected virtual void Dispose (bool disposing) { } - protected static object ToReturnValue (JniLocalReference handle, string signature, int n) + protected static object ToReturnValue (ref JniObjectReference handle, string signature, int n) { - var instance = JniEnvironment.Current.JavaVM.GetObject (handle, JniHandleOwnership.Transfer); + var instance = JniEnvironment.Current.JavaVM.GetObject (ref handle, JniHandleOwnership.Transfer); switch (signature [n]) { case 'L': return new DynamicJavaInstance (instance); diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodBase.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodBase.cs index 78c3fdc37..0542924c1 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodBase.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodBase.cs @@ -23,13 +23,13 @@ abstract class JavaMethodBase : JavaMemberInfo { protected abstract string JniReturnType {get;} - public JniGlobalReference SafeHandle {get; private set;} + public JniObjectReference PeerReference {get; private set;} public string JniSignature {get; private set;} protected JniPeerMembers members; - List arguments; - public List ArgumentTypes { + List arguments; + public List ArgumentTypes { get { LookupArguments (); return arguments; @@ -40,19 +40,20 @@ public string JniDeclaringClassName { get { return members == null ? "" : members.JniPeerTypeName; } } - public JavaMethodBase (JniPeerMembers members, JniReferenceSafeHandle method) + public JavaMethodBase (JniPeerMembers members, JniObjectReference method) { this.members = members; - SafeHandle = method.NewGlobalRef (); + PeerReference = method.NewGlobalRef (); } protected override void Dispose (bool disposing) { - if (!disposing || SafeHandle == null) + if (!disposing || !PeerReference.IsValid) return; - SafeHandle.Dispose (); - SafeHandle = null; + var pr = PeerReference; + JniEnvironment.Handles.Dispose (ref pr); + PeerReference = pr; members = null; @@ -60,8 +61,9 @@ protected override void Dispose (bool disposing) return; for (int i = 0; i < arguments.Count; ++i) { - arguments [i].Dispose (); - arguments [i] = null; + var a = arguments [i]; + JniEnvironment.Handles.Dispose (ref a); + arguments [i] = a; } arguments = null; } @@ -81,17 +83,22 @@ public void LookupArguments () sb.Append ("("); var parameters = IsConstructor - ? JavaClassInfo.GetConstructorParameters (SafeHandle) - : JavaClassInfo.GetMethodParameters (SafeHandle); - using (parameters) { + ? JavaClassInfo.GetConstructorParameters (PeerReference) + : JavaClassInfo.GetMethodParameters (PeerReference); + try { int len = JniEnvironment.Arrays.GetArrayLength (parameters); - arguments = new List (len); + arguments = new List (len); for (int i = 0; i < len; ++i) { - using (var p = JniEnvironment.Arrays.GetObjectArrayElement (parameters, i)) { + var p = JniEnvironment.Arrays.GetObjectArrayElement (parameters, i); + try { sb.Append (JniEnvironment.Types.GetJniTypeNameFromClass (p)); arguments.Add (p.NewGlobalRef ()); + } finally { + JniEnvironment.Handles.Dispose (ref p); } } + } finally { + JniEnvironment.Handles.Dispose (ref parameters); } sb.Append (")").Append (JniReturnType); JniSignature = sb.ToString (); @@ -107,14 +114,12 @@ public bool CompatibleWith (List args, DynamicMetaObject[] dargs) var vm = JniEnvironment.Current.JavaVM; for (int i = 0; i < arguments.Count; ++i) { - Debug.WriteLine ("# jonp: JavaMethodBase.CompatibleWith: arguments[{0}]={1} == {2} {3}", - i, JniEnvironment.Types.GetJniTypeNameFromClass (arguments [i]), args [i], dargs [i].LimitType); if (args [i] == null) { // Builtin type -- JNIEnv.FindClass("I") throws! if (JniEnvironment.Types.GetJniTypeNameFromClass (arguments [i]) != vm.GetJniTypeInfoForType (dargs [i].LimitType).JniTypeReference) return false; } - else if (!JniEnvironment.Types.IsAssignableFrom (arguments [i], args [i].SafeHandle)) + else if (!JniEnvironment.Types.IsAssignableFrom (arguments [i], args [i].PeerReference)) return false; } return true; diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodInfo.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodInfo.cs index 6edf99d71..4a099be86 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodInfo.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JavaMethodInfo.cs @@ -22,7 +22,7 @@ class JavaMethodInfo : JavaMethodBase { string name; bool isStatic; - public JavaMethodInfo (JniPeerMembers members, JniReferenceSafeHandle method, string name, bool isStatic) + public JavaMethodInfo (JniPeerMembers members, JniObjectReference method, string name, bool isStatic) : base (members, method) { this.name = name; @@ -94,7 +94,7 @@ unsafe object InvokeInstanceMethod (IJavaObject self, JValue* arguments) case 'L': case '[': var lref = members.InstanceMethods.CallObjectMethod (JniSignature, self, arguments); - return ToReturnValue (lref, JniSignature, e + 1); + return ToReturnValue (ref lref, JniSignature, e + 1); case 'V': members.InstanceMethods.CallVoidMethod (JniSignature, self, arguments); return null; @@ -118,7 +118,7 @@ unsafe object InvokeStaticMethod (JValue* arguments) case 'L': case '[': var lref = members.StaticMethods.CallObjectMethod (JniSignature, arguments); - return ToReturnValue (lref, JniSignature, e + 1); + return ToReturnValue (ref lref, JniSignature, e + 1); case 'V': members.StaticMethods.CallVoidMethod (JniSignature, arguments); return null; diff --git a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs index 4eddedd42..0b8b8bad8 100644 --- a/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs +++ b/src/Java.Interop.Dynamic/Java.Interop.Dynamic/JniMetaObject.cs @@ -28,7 +28,7 @@ public JniMetaObject (Expression parameter, object value, JavaClassInfo info) } protected abstract bool Disposed {get;} - protected abstract JniReferenceSafeHandle ConversionTarget {get;} + protected abstract JniObjectReference ConversionTarget {get;} protected abstract bool HasSelf {get;} protected abstract Expression GetSelf (); @@ -55,7 +55,8 @@ public override DynamicMetaObject BindConvert (ConvertBinder binder) if (marshalInfo.GetValueFromJni == null) return binder.FallbackConvert (this); - var value = marshalInfo.GetValueFromJni (ConversionTarget, JniHandleOwnership.DoNotTransfer, binder.Type); + var r = ConversionTarget; + var value = marshalInfo.GetValueFromJni (ref r, JniHandleOwnership.DoNotTransfer, binder.Type); var valueE = Expression.Convert (Expression.Constant (value), binder.Type); return new DynamicMetaObject (valueE, BindingRestrictions.GetTypeRestriction (valueE, binder.Type), value); } diff --git a/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic/DynamicJavaInstanceTests.cs b/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic/DynamicJavaInstanceTests.cs index cf74cbe93..9fd0a29c3 100644 --- a/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic/DynamicJavaInstanceTests.cs +++ b/src/Java.Interop.Dynamic/Tests/Java.Interop.Dynamic/DynamicJavaInstanceTests.cs @@ -40,9 +40,9 @@ public void DisposeWithJavaObjectDisposesObject ([Values (true, false)] bool reg Assert.AreEqual (-1, JavaClassInfo.GetClassInfoCount ("java/lang/Object")); if (register) { - Assert.IsFalse (native.SafeHandle.IsClosed || native.SafeHandle.IsInvalid); + Assert.IsTrue (native.PeerReference.IsValid); } else { - Assert.IsTrue (native.SafeHandle == null || native.SafeHandle.IsClosed || native.SafeHandle.IsInvalid); + Assert.IsFalse (native.PeerReference.IsValid); } } diff --git a/src/Java.Interop.Export/Java.Interop/ExportedMemberBuilder.cs b/src/Java.Interop.Export/Java.Interop/ExportedMemberBuilder.cs index b7b0fafb4..d30ff9e39 100644 --- a/src/Java.Interop.Export/Java.Interop/ExportedMemberBuilder.cs +++ b/src/Java.Interop.Export/Java.Interop/ExportedMemberBuilder.cs @@ -278,7 +278,7 @@ protected virtual Expression GetMarshalToJniExpression (Type sourceType, Express static readonly Dictionary Marshalers = new Dictionary () { { typeof (string), new MarshalInfo { FromJni = (vm, t, p) => Expression.Call (F (JniEnvironment.Strings.ToString).Method, p), - ToJni = p => Expression.Call (F (JniEnvironment.Strings.NewString).Method, p) + ToJni = p => Expression.Call (F (JniEnvironment.Strings.NewString).Method, p) } }, { typeof (IJavaObject), new MarshalInfo { FromJni = (vm, t, p) => GetThis (vm, t, p), diff --git a/src/Java.Interop.Export/Tests/Java.Interop/ExportTest.cs b/src/Java.Interop.Export/Tests/Java.Interop/ExportTest.cs index 794b1acd5..7f81dbf59 100644 --- a/src/Java.Interop.Export/Tests/Java.Interop/ExportTest.cs +++ b/src/Java.Interop.Export/Tests/Java.Interop/ExportTest.cs @@ -7,8 +7,8 @@ namespace Java.InteropTests [JniTypeInfo ("com/xamarin/interop/export/ExportType")] public class ExportTest : JavaObject { - public ExportTest (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public ExportTest (ref JniObjectReference reference, JniHandleOwnership transfer) + : base (ref reference, transfer) { } diff --git a/src/Java.Interop.Export/Tests/Java.Interop/ExportedMemberBuilderTest.cs b/src/Java.Interop.Export/Tests/Java.Interop/ExportedMemberBuilderTest.cs index 93c749fed..47ee0185a 100644 --- a/src/Java.Interop.Export/Tests/Java.Interop/ExportedMemberBuilderTest.cs +++ b/src/Java.Interop.Export/Tests/Java.Interop/ExportedMemberBuilderTest.cs @@ -34,13 +34,13 @@ public void AddExportMethods () t.RegisterNativeMethods (methods.ToArray ()); - t.GetStaticMethod ("testStaticMethods", "()V").CallVoidMethod (t.SafeHandle); + t.GetStaticMethod ("testStaticMethods", "()V").CallVoidMethod (t.PeerReference); Assert.IsTrue (ExportTest.StaticHelloCalled); Assert.IsTrue (ExportTest.StaticActionInt32StringCalled); using (var o = CreateExportTest (t)) { o.RegisterWithVM (); - t.GetInstanceMethod ("testMethods", "()V").CallVirtualVoidMethod (o.SafeHandle); + t.GetInstanceMethod ("testMethods", "()V").CallVirtualVoidMethod (o.PeerReference); Assert.IsTrue (o.HelloCalled); o.Dispose (); } @@ -60,7 +60,8 @@ static JniType CreateExportTestType () static unsafe ExportTest CreateExportTest (JniType type) { var c = type.GetConstructor ("()V"); - return new ExportTest (type.NewObject (c, null), JniHandleOwnership.Transfer); + var p = type.NewObject (c, null); + return new ExportTest (ref p, JniHandleOwnership.Transfer); } [Test] diff --git a/src/Java.Interop/Java.Interop.csproj b/src/Java.Interop/Java.Interop.csproj index 1e0ec0940..1f1cc6046 100644 --- a/src/Java.Interop/Java.Interop.csproj +++ b/src/Java.Interop/Java.Interop.csproj @@ -18,7 +18,7 @@ full false ..\..\bin\Debug - DEBUG;INTEROP + DEBUG;INTEROP;FEATURE_HANDLES_ARE_SAFE_HANDLES prompt 4 false @@ -49,7 +49,6 @@ - @@ -74,6 +73,8 @@ + + diff --git a/src/Java.Interop/Java.Interop/IJavaObject.cs b/src/Java.Interop/Java.Interop/IJavaObject.cs index 0a04c368c..78e1bc1eb 100644 --- a/src/Java.Interop/Java.Interop/IJavaObject.cs +++ b/src/Java.Interop/Java.Interop/IJavaObject.cs @@ -4,7 +4,7 @@ namespace Java.Interop { public interface IJavaObject : IDisposable { - JniReferenceSafeHandle SafeHandle {get;} + JniObjectReference PeerReference {get;} JniPeerMembers JniPeerMembers {get;} void RegisterWithVM (); diff --git a/src/Java.Interop/Java.Interop/IJavaObjectEx.cs b/src/Java.Interop/Java.Interop/IJavaObjectEx.cs index 10fe59a4a..35cc31b47 100644 --- a/src/Java.Interop/Java.Interop/IJavaObjectEx.cs +++ b/src/Java.Interop/Java.Interop/IJavaObjectEx.cs @@ -7,6 +7,6 @@ interface IJavaObjectEx { bool Registered {get; set;} void Dispose (bool disposing); - void SetSafeHandle (JniReferenceSafeHandle handle); + void SetPeerReference (JniObjectReference handle); } } diff --git a/src/Java.Interop/Java.Interop/IJniHandleManager.cs b/src/Java.Interop/Java.Interop/IJniHandleManager.cs index 0e1931773..4fd21e353 100644 --- a/src/Java.Interop/Java.Interop/IJniHandleManager.cs +++ b/src/Java.Interop/Java.Interop/IJniHandleManager.cs @@ -17,24 +17,24 @@ public interface IJniHandleManager : IDisposable { void WriteLocalReferenceLine (string format, params object[] args); - JniLocalReference CreateLocalReference (JniEnvironment environment, JniReferenceSafeHandle value); - void DeleteLocalReference (JniEnvironment environment, IntPtr value); + JniObjectReference CreateLocalReference (JniEnvironment environment, JniObjectReference value); + void DeleteLocalReference (JniEnvironment environment, ref JniObjectReference value); // JniLocalReference was created as a result of another JNI call, // e.g. JniEnvironment.Array.NewByteArray() - void CreatedLocalReference (JniEnvironment environment, JniLocalReference value); + void CreatedLocalReference (JniEnvironment environment, JniObjectReference value); // "Release" doesn't destroy the local ref; this is an "accounting" method // to give the VM to update local reference counts. The IntPtr returned // will be passed to the JVM as a JNI return value. - IntPtr ReleaseLocalReference (JniEnvironment environment, JniLocalReference value); + IntPtr ReleaseLocalReference (JniEnvironment environment, ref JniObjectReference value); void WriteGlobalReferenceLine (string format, params object[] args); - JniGlobalReference CreateGlobalReference (JniReferenceSafeHandle value); - void DeleteGlobalReference (IntPtr value); + JniObjectReference CreateGlobalReference (JniObjectReference value); + void DeleteGlobalReference (ref JniObjectReference value); - JniWeakGlobalReference CreateWeakGlobalReference (JniReferenceSafeHandle value); - void DeleteWeakGlobalReference (IntPtr value); + JniObjectReference CreateWeakGlobalReference (JniObjectReference value); + void DeleteWeakGlobalReference (ref JniObjectReference value); } } diff --git a/src/Java.Interop/Java.Interop/JValue.cs b/src/Java.Interop/Java.Interop/JValue.cs index 4b3b12b34..4dbe971a6 100644 --- a/src/Java.Interop/Java.Interop/JValue.cs +++ b/src/Java.Interop/Java.Interop/JValue.cs @@ -22,7 +22,7 @@ public struct JValue { [FieldOffset(0)] IntPtr l; #pragma warning restore 0414 - public static JValue Zero = new JValue ((JniReferenceSafeHandle) null); + public static JValue Zero = new JValue (IntPtr.Zero); public JValue (bool value) { @@ -72,17 +72,23 @@ public JValue (double value) d = value; } - public JValue (JniReferenceSafeHandle value) + JValue (IntPtr value) { this = new JValue (); - l = value == null ? IntPtr.Zero : value.DangerousGetHandle (); + l = value; + } + + public JValue (JniObjectReference value) + { + this = new JValue (); + l = value.Handle; } public JValue (IJavaObject value) { this = new JValue (); - if (value != null && value.SafeHandle != null && !value.SafeHandle.IsInvalid) - l = value.SafeHandle.DangerousGetHandle (); + if (value != null) + l = value.PeerReference.Handle; else l = IntPtr.Zero; } diff --git a/src/Java.Interop/Java.Interop/JavaArray.cs b/src/Java.Interop/Java.Interop/JavaArray.cs index 513733fac..d07dc2ecc 100644 --- a/src/Java.Interop/Java.Interop/JavaArray.cs +++ b/src/Java.Interop/Java.Interop/JavaArray.cs @@ -8,17 +8,20 @@ namespace Java.Interop { public abstract class JavaArray : JavaObject, IList, IList { + internal delegate TArray ArrayCreator (ref JniObjectReference reference, JniHandleOwnership transfer) + where TArray : JavaArray; + // Value was created via CreateMarshalCollection, and thus can // be disposed of with impunity when no longer needed. protected bool forMarshalCollection; - internal JavaArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + internal JavaArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } public int Length { - get {return JniEnvironment.Arrays.GetArrayLength (SafeHandle);} + get {return JniEnvironment.Arrays.GetArrayLength (PeerReference);} } public abstract T this [int index] { @@ -122,31 +125,31 @@ internal static Exception CreateMarshalNotSupportedException (Type sourceType, T sourceType.FullName, targetType.FullName)); } - internal static JniLocalReference CreateLocalRef (object value, Func, TArray> creator) + internal static JniObjectReference CreateLocalRef (object value, Func, TArray> creator) where TArray : JavaArray { if (value == null) - return new JniLocalReference (); + return new JniObjectReference (); var array = value as TArray; if (array != null) - return array.SafeHandle.NewLocalRef (); + return array.PeerReference.NewLocalRef (); var items = value as IList; if (items == null) throw CreateMarshalNotSupportedException (value.GetType (), typeof (TArray)); using (array = creator (items)) - return array.SafeHandle.NewLocalRef (); + return array.PeerReference.NewLocalRef (); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType, Func creator) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType, ArrayCreator creator) where TArray : JavaArray { - var value = JniEnvironment.Current.JavaVM.PeekObject (handle); + var value = JniEnvironment.Current.JavaVM.PeekObject (reference); var array = value as TArray; if (array != null) { - JniEnvironment.Handles.Dispose (handle, transfer); + JniEnvironment.Handles.Dispose (ref reference, transfer); return array.ToTargetType (targetType, dispose: false); } - return creator (handle, transfer) + return creator (ref reference, transfer) .ToTargetType (targetType, dispose: true); } @@ -347,8 +350,8 @@ public void Dispose () public abstract class JavaPrimitiveArray : JavaArray { - internal JavaPrimitiveArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + internal JavaPrimitiveArray (ref JniObjectReference reference, JniHandleOwnership transfer) + : base (ref reference, transfer) { } diff --git a/src/Java.Interop/Java.Interop/JavaException.cs b/src/Java.Interop/Java.Interop/JavaException.cs index 51aeb334a..6bb137fc6 100644 --- a/src/Java.Interop/Java.Interop/JavaException.cs +++ b/src/Java.Interop/Java.Interop/JavaException.cs @@ -3,7 +3,7 @@ namespace Java.Interop { [JniTypeInfo (JavaException.JniTypeName)] - public class JavaException : Exception, IJavaObject, IJavaObjectEx + unsafe public class JavaException : Exception, IJavaObject, IJavaObjectEx { internal const string JniTypeName = "java/lang/Throwable"; readonly static JniPeerMembers _members = new JniPeerMembers (JniTypeName, typeof (JavaException)); @@ -12,56 +12,78 @@ public class JavaException : Exception, IJavaObject, IJavaObjectEx bool registered; string javaStackTrace; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + JniObjectReference reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + IntPtr handle; + JniObjectReferenceType handle_type; +#endif // FEATURE_HANDLES_ARE_INTPTRS + + protected static readonly JniObjectReference* InvalidJniObjectReference = null; + public unsafe JavaException () { - using (SetSafeHandle ( - JniPeerMembers.InstanceMethods.StartCreateInstance ("()V", GetType (), null), - JniHandleOwnership.Transfer)) { + var peer = JniPeerMembers.InstanceMethods.StartCreateInstance ("()V", GetType (), null); + using (SetPeerReference ( + ref peer, + JniHandleOwnership.Transfer)) { JniPeerMembers.InstanceMethods.FinishCreateInstance ("()V", this, null); } - javaStackTrace = _GetJavaStack (SafeHandle); + javaStackTrace = _GetJavaStack (PeerReference); } public unsafe JavaException (string message) : base (message) { const string signature = "(Ljava/lang/String;)V"; - using (var native_message = JniEnvironment.Strings.NewString (message)) { + var native_message = JniEnvironment.Strings.NewString (message); + try { var args = stackalloc JValue [1]; args [0] = new JValue (native_message); - using (SetSafeHandle ( - JniPeerMembers.InstanceMethods.StartCreateInstance (signature, GetType (), args), + var peer = JniPeerMembers.InstanceMethods.StartCreateInstance (signature, GetType (), args); + using (SetPeerReference ( + ref peer, JniHandleOwnership.Transfer)) { JniPeerMembers.InstanceMethods.FinishCreateInstance (signature, this, args); } + } finally { + JniEnvironment.Handles.Dispose (ref native_message, JniHandleOwnership.Transfer); } - javaStackTrace = _GetJavaStack (SafeHandle); + javaStackTrace = _GetJavaStack (PeerReference); } public unsafe JavaException (string message, Exception innerException) : base (message, innerException) { const string signature = "(Ljava/lang/String;)V"; - using (var native_message = JniEnvironment.Strings.NewString (message)) { + var native_message = JniEnvironment.Strings.NewString (message); + try { var args = stackalloc JValue [1]; args [0] = new JValue (native_message); - using (SetSafeHandle ( - JniPeerMembers.InstanceMethods.StartCreateInstance (signature, GetType (), args), + var peer = JniPeerMembers.InstanceMethods.StartCreateInstance (signature, GetType (), args); + using (SetPeerReference ( + ref peer, JniHandleOwnership.Transfer)) { JniPeerMembers.InstanceMethods.FinishCreateInstance (signature, this, args); } + } finally { + JniEnvironment.Handles.Dispose (ref native_message, JniHandleOwnership.Transfer); } - javaStackTrace = _GetJavaStack (SafeHandle); + javaStackTrace = _GetJavaStack (PeerReference); } - public JavaException (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (_GetMessage (handle), _GetCause (handle)) + public JavaException (ref JniObjectReference reference, JniHandleOwnership transfer) + : base (_GetMessage (ref reference, transfer), _GetCause (ref reference, transfer)) { - if (handle == null || handle.IsInvalid) + if ((transfer & JniHandleOwnership.Invalid) == JniHandleOwnership.Invalid) + return; + + if (!reference.IsValid) return; - using (SetSafeHandle (handle, transfer)) { + using (SetPeerReference (ref reference, transfer)) { } - javaStackTrace = _GetJavaStack (SafeHandle); + javaStackTrace = _GetJavaStack (PeerReference); } ~JavaException () @@ -69,7 +91,16 @@ public JavaException (JniReferenceSafeHandle handle, JniHandleOwnership transfer JniEnvironment.Current.JavaVM.TryCollectObject (this); } - public JniReferenceSafeHandle SafeHandle {get; private set;} + public JniObjectReference PeerReference { + get { +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + return reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + return new JniObjectReference (handle, handle_type); +#endif // FEATURE_HANDLES_ARE_INTPTRS + } + } // Note: JniPeerMembers is invoked virtually from the constructor; // it MUST be valid before the derived constructor executes! @@ -90,11 +121,11 @@ public override string StackTrace { } } - protected SetSafeHandleCompletion SetSafeHandle (JniReferenceSafeHandle handle, JniHandleOwnership transfer) + protected SetSafeHandleCompletion SetPeerReference (ref JniObjectReference handle, JniHandleOwnership transfer) { - return JniEnvironment.Current.JavaVM.SetObjectSafeHandle ( + return JniEnvironment.Current.JavaVM.SetObjectPeerReference ( this, - handle, + ref handle, transfer, a => new SetSafeHandleCompletion (a)); } @@ -106,7 +137,7 @@ public void RegisterWithVM () public void Dispose () { - if (SafeHandle == null || SafeHandle.IsInvalid) + if (PeerReference.Handle == IntPtr.Zero) return; JniEnvironment.Current.JavaVM.DisposeObject (this); var inner = InnerException as JavaException; @@ -134,7 +165,7 @@ public override bool Equals (object obj) return true; var o = obj as IJavaObject; if (o != null) - return JniEnvironment.Types.IsSameObject (SafeHandle, o.SafeHandle); + return JniEnvironment.Types.IsSameObject (PeerReference, o.PeerReference); return false; } @@ -143,36 +174,49 @@ public override unsafe int GetHashCode () return _members.InstanceMethods.CallInt32Method ("hashCode\u0000()I", this, null); } - static string _GetMessage (JniReferenceSafeHandle handle) + static string _GetMessage (ref JniObjectReference reference, JniHandleOwnership transfer) { + if ((transfer & JniHandleOwnership.Invalid) == JniHandleOwnership.Invalid) + return null; + var m = _members.InstanceMethods.GetMethodID ("getMessage\u0000()Ljava/lang/String;"); - var s = m.CallVirtualObjectMethod (handle); - return JniEnvironment.Strings.ToString (s, JniHandleOwnership.Transfer); + var s = m.CallVirtualObjectMethod (reference); + return JniEnvironment.Strings.ToString (ref s, JniHandleOwnership.Transfer); } - static Exception _GetCause (JniReferenceSafeHandle handle) + static Exception _GetCause (ref JniObjectReference reference, JniHandleOwnership transfer) { + if ((transfer & JniHandleOwnership.Invalid) == JniHandleOwnership.Invalid) + return null; + var m = _members.InstanceMethods.GetMethodID ("getCause\u0000()Ljava/lang/Throwable;"); - var e = m.CallVirtualObjectMethod (handle); - return JniEnvironment.Current.JavaVM.GetExceptionForThrowable (e, JniHandleOwnership.Transfer); + var e = m.CallVirtualObjectMethod (reference); + return JniEnvironment.Current.JavaVM.GetExceptionForThrowable (ref e, JniHandleOwnership.Transfer); } - unsafe string _GetJavaStack (JniReferenceSafeHandle handle) + unsafe string _GetJavaStack (JniObjectReference handle) { using (var StringWriter_class = new JniType ("java/io/StringWriter")) - using (var StringWriter_init = StringWriter_class.GetConstructor ("()V")) - using (var swriter = StringWriter_class.NewObject (StringWriter_init, null)) - using (var PrintWriter_class = new JniType ("java/io/PrintWriter")) - using (var PrintWriter_init = PrintWriter_class.GetConstructor ("(Ljava/io/Writer;)V")) { - var pwriter_args = stackalloc JValue [1]; - pwriter_args [0] = new JValue (swriter); - using (var pwriter = PrintWriter_class.NewObject (PrintWriter_init, pwriter_args)) { - var pst = _members.InstanceMethods.GetMethodID ("printStackTrace\u0000(Ljava/io/PrintWriter;)V"); - var pst_args = stackalloc JValue [1]; - pst_args [0] = new JValue (pwriter); - pst.CallVirtualVoidMethod (handle, pst_args); - var s = JniEnvironment.Current.Object_toString.CallVirtualObjectMethod (swriter); - return JniEnvironment.Strings.ToString (s, JniHandleOwnership.Transfer); + using (var PrintWriter_class = new JniType ("java/io/PrintWriter")) { + var StringWriter_init = StringWriter_class.GetConstructor ("()V"); + var PrintWriter_init = PrintWriter_class.GetConstructor ("(Ljava/io/Writer;)V"); + var swriter = StringWriter_class.NewObject (StringWriter_init, null); + try { + var pwriter_args = stackalloc JValue [1]; + pwriter_args [0] = new JValue (swriter); + var pwriter = PrintWriter_class.NewObject (PrintWriter_init, pwriter_args); + try { + var pst = _members.InstanceMethods.GetMethodID ("printStackTrace\u0000(Ljava/io/PrintWriter;)V"); + var pst_args = stackalloc JValue [1]; + pst_args [0] = new JValue (pwriter); + pst.CallVirtualVoidMethod (handle, pst_args); + var s = JniEnvironment.Current.Object_toString.CallVirtualObjectMethod (swriter); + return JniEnvironment.Strings.ToString (ref s, JniHandleOwnership.Transfer); + } finally { + JniEnvironment.Handles.Dispose (ref pwriter, JniHandleOwnership.Transfer); + } + } finally { + JniEnvironment.Handles.Dispose (ref swriter, JniHandleOwnership.Transfer); } } } @@ -192,9 +236,15 @@ void IJavaObjectEx.Dispose (bool disposing) Dispose (disposing); } - void IJavaObjectEx.SetSafeHandle (JniReferenceSafeHandle handle) + void IJavaObjectEx.SetPeerReference (JniObjectReference reference) { - SafeHandle = handle; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + this.reference = reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + this.handle = reference.Handle; + this.handle_type = reference.Type; +#endif // FEATURE_HANDLES_ARE_INTPTRS } protected struct SetSafeHandleCompletion : IDisposable { diff --git a/src/Java.Interop/Java.Interop/JavaObject.cs b/src/Java.Interop/Java.Interop/JavaObject.cs index c99d7ddc7..0e757f4f9 100644 --- a/src/Java.Interop/Java.Interop/JavaObject.cs +++ b/src/Java.Interop/Java.Interop/JavaObject.cs @@ -3,19 +3,38 @@ namespace Java.Interop { [JniTypeInfo ("java/lang/Object")] - public class JavaObject : IJavaObject, IJavaObjectEx + unsafe public class JavaObject : IJavaObject, IJavaObjectEx { readonly static JniPeerMembers _members = new JniPeerMembers ("java/lang/Object", typeof (JavaObject)); int keyHandle; bool registered; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + JniObjectReference reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + IntPtr handle; + JniObjectReferenceType handle_type; +#endif // FEATURE_HANDLES_ARE_INTPTRS + + protected static readonly JniObjectReference* InvalidJniObjectReference = null; + ~JavaObject () { JniEnvironment.Current.JavaVM.TryCollectObject (this); } - public JniReferenceSafeHandle SafeHandle {get; private set;} + public JniObjectReference PeerReference { + get { +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + return reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + return new JniObjectReference (handle, handle_type); +#endif // FEATURE_HANDLES_ARE_INTPTRS + } + } // Note: JniPeerMembers is invoked virtually from the constructor; // it MUST be valid before the derived constructor executes! @@ -24,30 +43,32 @@ public virtual JniPeerMembers JniPeerMembers { get {return _members;} } - public JavaObject (JniReferenceSafeHandle handle, JniHandleOwnership transfer) + public JavaObject (ref JniObjectReference reference, JniHandleOwnership transfer) { - if (handle == null) + if ((transfer & JniHandleOwnership.Invalid) == JniHandleOwnership.Invalid) return; - using (SetSafeHandle (handle, transfer)) { + + using (SetPeerReference (ref reference, transfer)) { } } public unsafe JavaObject () { - using (SetSafeHandle ( - JniPeerMembers.InstanceMethods.StartCreateInstance ("()V", GetType (), null), - JniHandleOwnership.Transfer)) { + var peer = JniPeerMembers.InstanceMethods.StartCreateInstance ("()V", GetType (), null); + using (SetPeerReference ( + ref peer, + JniHandleOwnership.Transfer)) { JniPeerMembers.InstanceMethods.FinishCreateInstance ("()V", this, null); } } - protected SetSafeHandleCompletion SetSafeHandle (JniReferenceSafeHandle handle, JniHandleOwnership transfer) + protected SetPeerReferenceCompletion SetPeerReference (ref JniObjectReference handle, JniHandleOwnership transfer) { - return JniEnvironment.Current.JavaVM.SetObjectSafeHandle ( + return JniEnvironment.Current.JavaVM.SetObjectPeerReference ( this, - handle, + ref handle, transfer, - a => new SetSafeHandleCompletion (a)); + a => new SetPeerReferenceCompletion (a)); } public void RegisterWithVM () @@ -79,7 +100,7 @@ public override bool Equals (object obj) return true; var o = obj as IJavaObject; if (o != null) - return JniEnvironment.Types.IsSameObject (SafeHandle, o.SafeHandle); + return JniEnvironment.Types.IsSameObject (PeerReference, o.PeerReference); return false; } @@ -94,7 +115,7 @@ public override unsafe string ToString () "toString\u0000()Ljava/lang/String;", this, null); - return JniEnvironment.Strings.ToString (lref, JniHandleOwnership.Transfer); + return JniEnvironment.Strings.ToString (ref lref, JniHandleOwnership.Transfer); } int IJavaObjectEx.IdentityHashCode { @@ -112,16 +133,22 @@ void IJavaObjectEx.Dispose (bool disposing) Dispose (disposing); } - void IJavaObjectEx.SetSafeHandle (JniReferenceSafeHandle handle) + void IJavaObjectEx.SetPeerReference (JniObjectReference reference) { - SafeHandle = handle; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + this.reference = reference; +#endif // FEATURE_HANDLES_ARE_INTPTRS +#if FEATURE_HANDLES_ARE_INTPTRS + this.handle = reference.Handle; + this.handle_type = reference.Type; +#endif // FEATURE_HANDLES_ARE_INTPTRS } - protected struct SetSafeHandleCompletion : IDisposable { + protected struct SetPeerReferenceCompletion : IDisposable { readonly Action action; - public SetSafeHandleCompletion (Action action) + public SetPeerReferenceCompletion (Action action) { this.action = action; } diff --git a/src/Java.Interop/Java.Interop/JavaObjectArray.cs b/src/Java.Interop/Java.Interop/JavaObjectArray.cs index 0488d9ce2..0d19a2c23 100644 --- a/src/Java.Interop/Java.Interop/JavaObjectArray.cs +++ b/src/Java.Interop/Java.Interop/JavaObjectArray.cs @@ -5,12 +5,12 @@ namespace Java.Interop { public class JavaObjectArray : JavaArray { - public JavaObjectArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaObjectArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - static JniLocalReference _NewArray (int length) + static JniObjectReference _NewArray (int length) { var info = JniEnvironment.Current.JavaVM.GetJniTypeInfoForType (typeof (T)); if (info.JniTypeName == null) @@ -20,13 +20,16 @@ static JniLocalReference _NewArray (int length) info.JniTypeName = JniInteger.JniTypeName; } using (var t = new JniType (info.ToString ())) { - return JniEnvironment.Arrays.NewObjectArray (length, t.SafeHandle, JniReferenceSafeHandle.Null); + return JniEnvironment.Arrays.NewObjectArray (length, t.PeerReference, new JniObjectReference ()); } } - public JavaObjectArray (int length) - : this (_NewArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaObjectArray (int length) + : this (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = _NewArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaObjectArray (IList value) @@ -56,14 +59,15 @@ public override T this [int index] { T GetElementAt (int index) { - var lref = JniEnvironment.Arrays.GetObjectArrayElement (SafeHandle, index); - return JniMarshal.GetValue (lref, JniHandleOwnership.Transfer); + var lref = JniEnvironment.Arrays.GetObjectArrayElement (PeerReference, index); + return JniMarshal.GetValue (ref lref, JniHandleOwnership.Transfer); } void SetElementAt (int index, T value) { - using (var h = JniMarshal.CreateLocalRef (value)) - JniEnvironment.Arrays.SetObjectArrayElement (SafeHandle, index, h); + var h = JniMarshal.CreateLocalRef (value); + JniEnvironment.Arrays.SetObjectArrayElement (PeerReference, index, h); + JniEnvironment.Handles.Dispose (ref h, JniHandleOwnership.Transfer); } public override IEnumerator GetEnumerator () @@ -77,11 +81,11 @@ public override IEnumerator GetEnumerator () public override void Clear () { int len = Length; - using (var v = JniMarshal.CreateLocalRef (default (T))) { - for (int i = 0; i < len; i++) { - JniEnvironment.Arrays.SetObjectArrayElement (SafeHandle, i, v); - } + var v = JniMarshal.CreateLocalRef (default (T)); + for (int i = 0; i < len; i++) { + JniEnvironment.Arrays.SetObjectArrayElement (PeerReference, i, v); } + JniEnvironment.Handles.Dispose (ref v, JniHandleOwnership.Transfer); } public override int IndexOf (T item) @@ -129,14 +133,14 @@ internal override bool TargetTypeIsCurrentType (Type targetType) targetType == typeof (JavaObjectArray); } - internal static object GetValue (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static object GetValue (ref JniObjectReference handle, JniHandleOwnership transfer, Type targetType) { - return JavaArray.GetValueFromJni (handle, transfer, targetType, (h, T) => new JavaObjectArray (h, T) { + return JavaArray.GetValueFromJni (ref handle, transfer, targetType, (ref JniObjectReference h, JniHandleOwnership t) => new JavaObjectArray (ref h, t) { forMarshalCollection = true, }); } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef (value, list => new JavaObjectArray(list)); } diff --git a/src/Java.Interop/Java.Interop/JavaObjectExtensions.cs b/src/Java.Interop/Java.Interop/JavaObjectExtensions.cs index 4d39c3261..494118177 100644 --- a/src/Java.Interop/Java.Interop/JavaObjectExtensions.cs +++ b/src/Java.Interop/Java.Interop/JavaObjectExtensions.cs @@ -7,20 +7,20 @@ public static class JavaObjectExtensions { public static string GetJniTypeName (this IJavaObject self) { JniPeerMembers.AssertSelf (self); - return JniEnvironment.Types.GetJniTypeNameFromInstance (self.SafeHandle); + return JniEnvironment.Types.GetJniTypeNameFromInstance (self.PeerReference); } - internal static object GetValue (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static object GetValue (ref JniObjectReference handle, JniHandleOwnership transfer, Type targetType) { - return JniEnvironment.Current.JavaVM.GetObject (handle, transfer, targetType); + return JniEnvironment.Current.JavaVM.GetObject (ref handle, transfer, targetType); } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { var o = value as IJavaObject; - if (o == null || o.SafeHandle == null || o.SafeHandle.IsInvalid) - return new JniLocalReference (); - return o.SafeHandle.NewLocalRef (); + if (o == null || !o.PeerReference.IsValid) + return new JniObjectReference (); + return o.PeerReference.NewLocalRef (); } } } diff --git a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs index 459084d74..b7b2c5a98 100644 --- a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs +++ b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.cs @@ -222,9 +222,9 @@ partial class JavaVM { } public sealed class JniBooleanArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniBooleanArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniBooleanArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -243,14 +243,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("Z", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaBooleanArray : JavaPrimitiveArray { - public JavaBooleanArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaBooleanArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaBooleanArray (int length) - : base (JniEnvironment.Arrays.NewBooleanArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaBooleanArray (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewBooleanArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaBooleanArray (System.Collections.Generic.IList value) @@ -271,8 +274,8 @@ protected override JniArrayElements CreateElements () public new JniBooleanArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetBooleanArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniBooleanArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetBooleanArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniBooleanArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Boolean item) @@ -312,7 +315,7 @@ public override unsafe void CopyTo (int sourceIndex, Boolean[] destinationArray, return; fixed (Boolean* b = destinationArray) - JniEnvironment.Arrays.GetBooleanArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetBooleanArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Boolean[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -324,7 +327,7 @@ public override unsafe void CopyFrom (Boolean[] sourceArray, int sourceIndex, in return; fixed (Boolean* b = sourceArray) - JniEnvironment.Arrays.SetBooleanArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetBooleanArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -334,20 +337,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaBooleanArray) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaBooleanArray (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaBooleanArray (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaBooleanArray (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -365,9 +368,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniSByteArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniSByteArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniSByteArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -386,14 +389,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("B", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaSByteArray : JavaPrimitiveArray { - public JavaSByteArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaSByteArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaSByteArray (int length) - : base (JniEnvironment.Arrays.NewByteArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaSByteArray (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewByteArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaSByteArray (System.Collections.Generic.IList value) @@ -414,8 +420,8 @@ protected override JniArrayElements CreateElements () public new JniSByteArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetByteArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniSByteArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetByteArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniSByteArrayElements (PeerReference, elements); } public override unsafe int IndexOf (SByte item) @@ -455,7 +461,7 @@ public override unsafe void CopyTo (int sourceIndex, SByte[] destinationArray, i return; fixed (SByte* b = destinationArray) - JniEnvironment.Arrays.GetByteArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetByteArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (SByte[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -467,7 +473,7 @@ public override unsafe void CopyFrom (SByte[] sourceArray, int sourceIndex, int return; fixed (SByte* b = sourceArray) - JniEnvironment.Arrays.SetByteArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetByteArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -477,20 +483,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaSByteArray) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaSByteArray (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaSByteArray (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaSByteArray (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -508,9 +514,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniCharArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniCharArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniCharArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -529,14 +535,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("C", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaCharArray : JavaPrimitiveArray { - public JavaCharArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaCharArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaCharArray (int length) - : base (JniEnvironment.Arrays.NewCharArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaCharArray (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewCharArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaCharArray (System.Collections.Generic.IList value) @@ -557,8 +566,8 @@ protected override JniArrayElements CreateElements () public new JniCharArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetCharArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniCharArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetCharArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniCharArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Char item) @@ -598,7 +607,7 @@ public override unsafe void CopyTo (int sourceIndex, Char[] destinationArray, in return; fixed (Char* b = destinationArray) - JniEnvironment.Arrays.GetCharArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetCharArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Char[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -610,7 +619,7 @@ public override unsafe void CopyFrom (Char[] sourceArray, int sourceIndex, int d return; fixed (Char* b = sourceArray) - JniEnvironment.Arrays.SetCharArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetCharArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -620,20 +629,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaCharArray) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaCharArray (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaCharArray (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaCharArray (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -651,9 +660,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniInt16ArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniInt16ArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniInt16ArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -672,14 +681,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("S", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaInt16Array : JavaPrimitiveArray { - public JavaInt16Array (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaInt16Array (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaInt16Array (int length) - : base (JniEnvironment.Arrays.NewShortArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaInt16Array (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewShortArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaInt16Array (System.Collections.Generic.IList value) @@ -700,8 +712,8 @@ protected override JniArrayElements CreateElements () public new JniInt16ArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetShortArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniInt16ArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetShortArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniInt16ArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Int16 item) @@ -741,7 +753,7 @@ public override unsafe void CopyTo (int sourceIndex, Int16[] destinationArray, i return; fixed (Int16* b = destinationArray) - JniEnvironment.Arrays.GetShortArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetShortArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Int16[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -753,7 +765,7 @@ public override unsafe void CopyFrom (Int16[] sourceArray, int sourceIndex, int return; fixed (Int16* b = sourceArray) - JniEnvironment.Arrays.SetShortArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetShortArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -763,20 +775,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaInt16Array) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaInt16Array (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaInt16Array (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaInt16Array (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -794,9 +806,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniInt32ArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniInt32ArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniInt32ArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -815,14 +827,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("I", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaInt32Array : JavaPrimitiveArray { - public JavaInt32Array (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaInt32Array (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaInt32Array (int length) - : base (JniEnvironment.Arrays.NewIntArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaInt32Array (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewIntArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaInt32Array (System.Collections.Generic.IList value) @@ -843,8 +858,8 @@ protected override JniArrayElements CreateElements () public new JniInt32ArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetIntArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniInt32ArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetIntArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniInt32ArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Int32 item) @@ -884,7 +899,7 @@ public override unsafe void CopyTo (int sourceIndex, Int32[] destinationArray, i return; fixed (Int32* b = destinationArray) - JniEnvironment.Arrays.GetIntArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetIntArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Int32[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -896,7 +911,7 @@ public override unsafe void CopyFrom (Int32[] sourceArray, int sourceIndex, int return; fixed (Int32* b = sourceArray) - JniEnvironment.Arrays.SetIntArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetIntArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -906,20 +921,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaInt32Array) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaInt32Array (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaInt32Array (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaInt32Array (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -937,9 +952,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniInt64ArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniInt64ArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniInt64ArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -958,14 +973,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("J", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaInt64Array : JavaPrimitiveArray { - public JavaInt64Array (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaInt64Array (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaInt64Array (int length) - : base (JniEnvironment.Arrays.NewLongArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaInt64Array (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewLongArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaInt64Array (System.Collections.Generic.IList value) @@ -986,8 +1004,8 @@ protected override JniArrayElements CreateElements () public new JniInt64ArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetLongArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniInt64ArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetLongArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniInt64ArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Int64 item) @@ -1027,7 +1045,7 @@ public override unsafe void CopyTo (int sourceIndex, Int64[] destinationArray, i return; fixed (Int64* b = destinationArray) - JniEnvironment.Arrays.GetLongArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetLongArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Int64[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -1039,7 +1057,7 @@ public override unsafe void CopyFrom (Int64[] sourceArray, int sourceIndex, int return; fixed (Int64* b = sourceArray) - JniEnvironment.Arrays.SetLongArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetLongArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -1049,20 +1067,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaInt64Array) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaInt64Array (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaInt64Array (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaInt64Array (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -1080,9 +1098,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniSingleArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniSingleArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniSingleArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -1101,14 +1119,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("F", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaSingleArray : JavaPrimitiveArray { - public JavaSingleArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaSingleArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaSingleArray (int length) - : base (JniEnvironment.Arrays.NewFloatArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaSingleArray (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewFloatArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaSingleArray (System.Collections.Generic.IList value) @@ -1129,8 +1150,8 @@ protected override JniArrayElements CreateElements () public new JniSingleArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetFloatArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniSingleArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetFloatArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniSingleArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Single item) @@ -1170,7 +1191,7 @@ public override unsafe void CopyTo (int sourceIndex, Single[] destinationArray, return; fixed (Single* b = destinationArray) - JniEnvironment.Arrays.GetFloatArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetFloatArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Single[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -1182,7 +1203,7 @@ public override unsafe void CopyFrom (Single[] sourceArray, int sourceIndex, int return; fixed (Single* b = sourceArray) - JniEnvironment.Arrays.SetFloatArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetFloatArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -1192,20 +1213,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaSingleArray) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaSingleArray (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaSingleArray (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaSingleArray (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) @@ -1223,9 +1244,9 @@ internal static void CleanupMarshalCollection (IJavaObject marshalObject, object public sealed class JniDoubleArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal JniDoubleArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal JniDoubleArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -1244,14 +1265,17 @@ protected override void Synchronize (JniArrayElementsReleaseMode releaseMode) [JniTypeInfo ("D", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class JavaDoubleArray : JavaPrimitiveArray { - public JavaDoubleArray (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public JavaDoubleArray (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public JavaDoubleArray (int length) - : base (JniEnvironment.Arrays.NewDoubleArray (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe JavaDoubleArray (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.NewDoubleArray (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public JavaDoubleArray (System.Collections.Generic.IList value) @@ -1272,8 +1296,8 @@ protected override JniArrayElements CreateElements () public new JniDoubleArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.GetDoubleArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new JniDoubleArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.GetDoubleArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new JniDoubleArrayElements (PeerReference, elements); } public override unsafe int IndexOf (Double item) @@ -1313,7 +1337,7 @@ public override unsafe void CopyTo (int sourceIndex, Double[] destinationArray, return; fixed (Double* b = destinationArray) - JniEnvironment.Arrays.GetDoubleArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.GetDoubleArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (Double[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -1325,7 +1349,7 @@ public override unsafe void CopyFrom (Double[] sourceArray, int sourceIndex, int return; fixed (Double* b = sourceArray) - JniEnvironment.Arrays.SetDoubleArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.SetDoubleArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -1335,20 +1359,20 @@ internal override bool TargetTypeIsCurrentType (Type targetType) typeof (JavaDoubleArray) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray.CreateLocalRef ( value, list => new JavaDoubleArray (list)); } - internal static IList GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new JavaDoubleArray (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new JavaDoubleArray (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) diff --git a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.tt b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.tt index 435b82ba7..9a5717579 100644 --- a/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.tt +++ b/src/Java.Interop/Java.Interop/JavaPrimitiveArrays.tt @@ -72,9 +72,9 @@ namespace Java.Interop { #> public sealed class Jni<#= info.TypeModifier #>ArrayElements : JniArrayElements { - JniReferenceSafeHandle arrayHandle; + JniObjectReference arrayHandle; - internal Jni<#= info.TypeModifier #>ArrayElements (JniReferenceSafeHandle arrayHandle, IntPtr elements) + internal Jni<#= info.TypeModifier #>ArrayElements (JniObjectReference arrayHandle, IntPtr elements) : base (elements) { this.arrayHandle = arrayHandle; @@ -93,14 +93,17 @@ namespace Java.Interop { [JniTypeInfo ("<#= info.JniType #>", ArrayRank=1, TypeIsKeyword=true)] public sealed partial class Java<#= info.TypeModifier #>Array : JavaPrimitiveArray<<#= info.ManagedType #>> { - public Java<#= info.TypeModifier #>Array (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public Java<#= info.TypeModifier #>Array (ref JniObjectReference handle, JniHandleOwnership transfer) + : base (ref handle, transfer) { } - public Java<#= info.TypeModifier #>Array (int length) - : base (JniEnvironment.Arrays.New<#= info.JniMarshalType #>Array (CheckLength (length)), JniHandleOwnership.Transfer) + public unsafe Java<#= info.TypeModifier #>Array (int length) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = JniEnvironment.Arrays.New<#= info.JniMarshalType #>Array (CheckLength (length)); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } public Java<#= info.TypeModifier #>Array (System.Collections.Generic.IList<<#= info.ManagedType #>> value) @@ -121,8 +124,8 @@ namespace Java.Interop { public new Jni<#= info.TypeModifier #>ArrayElements GetElements () { - IntPtr elements = JniEnvironment.Arrays.Get<#= info.JniMarshalType #>ArrayElements (SafeHandle, IntPtr.Zero); - return elements == IntPtr.Zero ? null : new Jni<#= info.TypeModifier #>ArrayElements (SafeHandle, elements); + IntPtr elements = JniEnvironment.Arrays.Get<#= info.JniMarshalType #>ArrayElements (PeerReference, IntPtr.Zero); + return elements == IntPtr.Zero ? null : new Jni<#= info.TypeModifier #>ArrayElements (PeerReference, elements); } public override unsafe int IndexOf (<#= info.ManagedType #> item) @@ -162,7 +165,7 @@ namespace Java.Interop { return; fixed (<#= info.ManagedType #>* b = destinationArray) - JniEnvironment.Arrays.Get<#= info.JniMarshalType #>ArrayRegion (SafeHandle, sourceIndex, length, (IntPtr) (b+destinationIndex)); + JniEnvironment.Arrays.Get<#= info.JniMarshalType #>ArrayRegion (PeerReference, sourceIndex, length, (IntPtr) (b+destinationIndex)); } public override unsafe void CopyFrom (<#= info.ManagedType #>[] sourceArray, int sourceIndex, int destinationIndex, int length) @@ -174,7 +177,7 @@ namespace Java.Interop { return; fixed (<#= info.ManagedType #>* b = sourceArray) - JniEnvironment.Arrays.Set<#= info.JniMarshalType #>ArrayRegion (SafeHandle, destinationIndex, length, (IntPtr) (b+sourceIndex)); + JniEnvironment.Arrays.Set<#= info.JniMarshalType #>ArrayRegion (PeerReference, destinationIndex, length, (IntPtr) (b+sourceIndex)); } internal override bool TargetTypeIsCurrentType (Type targetType) @@ -184,20 +187,20 @@ namespace Java.Interop { typeof (Java<#= info.TypeModifier #>Array) == targetType; } - internal static JniLocalReference CreateLocalRef (object value) + internal static JniObjectReference CreateLocalRef (object value) { return JavaArray<<#= info.ManagedType #>>.CreateLocalRefArray> ( value, list => new Java<#= info.TypeModifier #>Array (list)); } - internal static IList<<#= info.ManagedType #>> GetValueFromJni (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + internal static IList<<#= info.ManagedType #>> GetValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { return JavaArray<<#= info.ManagedType #>>.GetValueFromJni ( - handle, + ref reference, transfer, targetType, - (h, t) => new Java<#= info.TypeModifier #>Array (h, t)); + (ref JniObjectReference h, JniHandleOwnership t) => new Java<#= info.TypeModifier #>Array (ref h, t)); } internal static IJavaObject CreateMarshalCollection (object value) diff --git a/src/Java.Interop/Java.Interop/JavaProxyObject.cs b/src/Java.Interop/Java.Interop/JavaProxyObject.cs index 67ae5588b..b4de86f41 100644 --- a/src/Java.Interop/Java.Interop/JavaProxyObject.cs +++ b/src/Java.Interop/Java.Interop/JavaProxyObject.cs @@ -85,8 +85,12 @@ static IntPtr _ToString (IntPtr jnienv, IntPtr n_self) { var self = JniEnvironment.Current.JavaVM.GetObject (n_self); var s = self.ToString (); - using (var r = JniEnvironment.Strings.NewString (s)) + var r = JniEnvironment.Strings.NewString (s); + try { return JniEnvironment.Handles.NewReturnToJniRef (r); + } finally { + JniEnvironment.Handles.Dispose (ref r); + } } } } diff --git a/src/Java.Interop/Java.Interop/JavaVM.cs b/src/Java.Interop/Java.Interop/JavaVM.cs index 95da87c83..739c32099 100644 --- a/src/Java.Interop/Java.Interop/JavaVM.cs +++ b/src/Java.Interop/Java.Interop/JavaVM.cs @@ -9,11 +9,11 @@ namespace Java.Interop { - delegate int DestroyJavaVMDelegate (JavaVMSafeHandle javavm); - delegate int GetEnvDelegate (JavaVMSafeHandle javavm, out IntPtr envptr, int version); - delegate int AttachCurrentThreadDelegate (JavaVMSafeHandle javavm, out IntPtr env, ref JavaVMThreadAttachArgs args); - delegate int DetachCurrentThreadDelegate (JavaVMSafeHandle javavm); - delegate int AttachCurrentThreadAsDaemonDelegate (JavaVMSafeHandle javavm, out IntPtr env, IntPtr args); + delegate int DestroyJavaVMDelegate (IntPtr javavm); + delegate int GetEnvDelegate (IntPtr javavm, out IntPtr envptr, int version); + delegate int AttachCurrentThreadDelegate (IntPtr javavm, out IntPtr env, ref JavaVMThreadAttachArgs args); + delegate int DetachCurrentThreadDelegate (IntPtr javavm); + delegate int AttachCurrentThreadAsDaemonDelegate (IntPtr javavm, out IntPtr env, IntPtr args); struct JavaVMInterface { public IntPtr reserved0; @@ -40,43 +40,6 @@ struct JavaVMThreadAttachArgs { public IntPtr group; /* global ref of a ThreadGroup object, or NULL */ } - public sealed class JavaVMSafeHandle : SafeHandle { - - JavaVMSafeHandle () - : base (IntPtr.Zero, ownsHandle:false) - { - } - - public JavaVMSafeHandle (IntPtr handle) - : this () - { - SetHandle (handle); - } - - public override bool IsInvalid { - get {return handle == IntPtr.Zero;} - } - - internal IntPtr Handle { - get {return base.handle;} - } - - protected override bool ReleaseHandle () - { - return false; - } - - internal unsafe JavaVMInterface CreateInvoker () - { - IntPtr p = Marshal.ReadIntPtr (handle); - return (JavaVMInterface) Marshal.PtrToStructure (p, typeof(JavaVMInterface)); - } - - public override string ToString () - { - return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); - } - } public class JavaVMOptions { @@ -86,8 +49,8 @@ public class JavaVMOptions { // Prefer JNIEnv::NewObject() over JNIEnv::AllocObject() + JNIEnv::CallNonvirtualVoidMethod() public bool NewObjectRequired {get; set;} - public JavaVMSafeHandle VMHandle {get; set;} - public JniEnvironmentSafeHandle EnvironmentHandle {get; set;} + public IntPtr InvocationPointer {get; set;} + public IntPtr EnvironmentPointer {get; set;} public IJniHandleManager JniHandleManager {get; set;} public JavaVMOptions () @@ -105,10 +68,10 @@ public static IEnumerable GetRegisteredJavaVMs () return JavaVMs.Values; } - public static JavaVM GetRegisteredJavaVM (JavaVMSafeHandle handle) + public static JavaVM GetRegisteredJavaVM (IntPtr handle) { JavaVM vm; - return JavaVMs.TryGetValue (handle.DangerousGetHandle (), out vm) + return JavaVMs.TryGetValue (handle, out vm) ? vm : null; } @@ -136,16 +99,16 @@ public static void SetCurrent (JavaVM newCurrent) { if (newCurrent == null) throw new ArgumentNullException ("newCurrent"); - JavaVMs.TryAdd (newCurrent.SafeHandle.DangerousGetHandle (), newCurrent); + JavaVMs.TryAdd (newCurrent.InvocationPointer, newCurrent); current = newCurrent; } - ConcurrentDictionary TrackedInstances = new ConcurrentDictionary (); + ConcurrentDictionary TrackedInstances = new ConcurrentDictionary (); JavaVMInterface Invoker; bool DestroyVM; - public JavaVMSafeHandle SafeHandle {get; private set;} + public IntPtr InvocationPointer {get; private set;} public bool NewObjectRequired {get; private set;} @@ -153,10 +116,8 @@ protected JavaVM (JavaVMOptions options) { if (options == null) throw new ArgumentNullException ("options"); - if (options.VMHandle == null) - throw new ArgumentException ("options.VMHandle is null", "options"); - if (options.VMHandle.IsInvalid) - throw new ArgumentException ("options.VMHandle is not valid.", "options"); + if (options.InvocationPointer == IntPtr.Zero) + throw new ArgumentException ("options.InvocationPointer is null", "options"); TrackIDs = options.TrackIDs; DestroyVM = options.DestroyVMOnDispose; @@ -164,22 +125,28 @@ protected JavaVM (JavaVMOptions options) JniHandleManager = options.JniHandleManager ?? new JniHandleManager (); NewObjectRequired = options.NewObjectRequired; - SafeHandle = options.VMHandle; - Invoker = SafeHandle.CreateInvoker (); + InvocationPointer = options.InvocationPointer; + Invoker = CreateInvoker (InvocationPointer); if (current == null) current = this; - if (options.EnvironmentHandle != null) { - var env = new JniEnvironment (options.EnvironmentHandle, this); + if (options.EnvironmentPointer != IntPtr.Zero) { + var env = new JniEnvironment (options.EnvironmentPointer, this); JniEnvironment.SetRootEnvironment (env); } - JavaVMs.TryAdd (SafeHandle.DangerousGetHandle (), this); + JavaVMs.TryAdd (InvocationPointer, this); ManagedPeer.Init (); } + static unsafe JavaVMInterface CreateInvoker (IntPtr handle) + { + IntPtr p = Marshal.ReadIntPtr (handle); + return (JavaVMInterface) Marshal.PtrToStructure (p, typeof (JavaVMInterface)); + } + ~JavaVM () { Dispose (false); @@ -194,7 +161,7 @@ public virtual void FailFast (string message) public override string ToString () { - return string.Format ("{0}(0x{1})", GetType ().FullName, SafeHandle.DangerousGetHandle ().ToString ("x")); + return string.Format ("{0}(0x{1})", GetType ().FullName, InvocationPointer.ToString ("x")); } public void Dispose () @@ -204,7 +171,7 @@ public void Dispose () protected virtual void Dispose (bool disposing) { - if (SafeHandle == null || SafeHandle.IsInvalid) + if (InvocationPointer == IntPtr.Zero) return; if (current == this) @@ -217,18 +184,17 @@ protected virtual void Dispose (bool disposing) RegisteredInstances.Clear (); ClearTrackedReferences (); JavaVM _; - JavaVMs.TryRemove (SafeHandle.DangerousGetHandle (), out _); + JavaVMs.TryRemove (InvocationPointer, out _); JniHandleManager.Dispose (); // TODO: Dispose JniEnvironment.RootEnvironments // Requires .NET 4.5+ JniEnvironment.RootEnvironments.Dispose (); if (DestroyVM) DestroyJavaVM (); - SafeHandle.Dispose (); - SafeHandle = null; + InvocationPointer = IntPtr.Zero; } - public JniEnvironment AttachCurrentThread (string name = null, JniReferenceSafeHandle group = null) + public JniEnvironment AttachCurrentThread (string name = null, JniObjectReference group = default (JniObjectReference)) { var threadArgs = new JavaVMThreadAttachArgs () { version = JniVersion.v1_2, @@ -236,13 +202,13 @@ public JniEnvironment AttachCurrentThread (string name = null, JniReferenceSafeH try { if (name != null) threadArgs.name = Marshal.StringToHGlobalAnsi (name); - if (group != null) - threadArgs.group = group.DangerousGetHandle (); + if (group.IsValid) + threadArgs.group = group.Handle; IntPtr jnienv; - int r = Invoker.AttachCurrentThread (SafeHandle, out jnienv, ref threadArgs); + int r = Invoker.AttachCurrentThread (InvocationPointer, out jnienv, ref threadArgs); if (r != 0) throw new NotSupportedException ("AttachCurrentThread returned " + r); - var env = new JniEnvironment (new JniEnvironmentSafeHandle (jnienv), this); + var env = new JniEnvironment (jnienv, this); return env; } finally { Marshal.FreeHGlobal (threadArgs.name); @@ -251,21 +217,21 @@ public JniEnvironment AttachCurrentThread (string name = null, JniReferenceSafeH public void DestroyJavaVM () { - Invoker.DestroyJavaVM (SafeHandle); + Invoker.DestroyJavaVM (InvocationPointer); } - public virtual Exception GetExceptionForThrowable (JniLocalReference value, JniHandleOwnership transfer) + public virtual Exception GetExceptionForThrowable (ref JniObjectReference value, JniHandleOwnership transfer) { var o = PeekObject (value); var e = o as JavaException; if (e != null) { - JniEnvironment.Handles.Dispose (value, transfer); + JniEnvironment.Handles.Dispose (ref value, transfer); var p = e as JavaProxyThrowable; if (p != null) return p.Exception; return e; } - return GetObject (value, transfer); + return GetObject (ref value, transfer); } public int GlobalReferenceCount { @@ -280,7 +246,7 @@ public int WeakGlobalReferenceCount { public bool TrackIDs {get; private set;} - internal void TrackID (SafeHandle key, IDisposable value) + internal void TrackID (IntPtr key, IDisposable value) { if (TrackIDs) TrackedInstances.TryAdd (key, value); @@ -288,10 +254,10 @@ internal void TrackID (SafeHandle key, IDisposable value) internal void Track (JniType value) { - TrackedInstances.TryAdd (value.SafeHandle, value); + TrackedInstances.TryAdd (value.PeerReference.Handle, value); } - internal void UnTrack (SafeHandle key) + internal void UnTrack (IntPtr key) { IDisposable _; TrackedInstances.TryRemove (key, out _); @@ -322,15 +288,15 @@ public List GetSurfacedObjects () internal void RegisterObject (T value) where T : IJavaObject, IJavaObjectEx { - if (value.SafeHandle == null || value.SafeHandle.IsInvalid) + var r = value.PeerReference; + if (!r.IsValid) throw new ObjectDisposedException (value.GetType ().FullName); if (value.Registered) return; - if (value.SafeHandle.ReferenceType != JniReferenceType.Global) { - var o = value.SafeHandle; - value.SetSafeHandle (o.NewGlobalRef ()); - o.Dispose (); + if (r.Type != JniObjectReferenceType.Global) { + value.SetPeerReference (r.NewGlobalRef ()); + JniEnvironment.Handles.Dispose (ref r, JniHandleOwnership.Transfer); } int key = value.IdentityHashCode; lock (RegisteredInstances) { @@ -339,8 +305,8 @@ internal void RegisterObject (T value) if (RegisteredInstances.TryGetValue (key, out existing) && (target = (IJavaObject) existing.Target) != null) throw new NotSupportedException ( string.Format ("Cannot register instance {0}(0x{1}), as an instance with the same handle {2}(0x{3}) has already been registered.", - value.GetType ().FullName, value.SafeHandle.DangerousGetHandle ().ToString ("x"), - target.GetType ().FullName, target.SafeHandle.DangerousGetHandle ().ToString ("x"))); + value.GetType ().FullName, value.PeerReference.ToString (), + target.GetType ().FullName, target.PeerReference.ToString ())); RegisteredInstances [key] = new WeakReference (value, trackResurrection: true); } value.Registered = true; @@ -360,28 +326,27 @@ internal void UnRegisterObject (IJavaObjectEx value) } } - internal TCleanup SetObjectSafeHandle (T value, JniReferenceSafeHandle handle, JniHandleOwnership transfer, Func createCleanup) + internal TCleanup SetObjectPeerReference (T value, ref JniObjectReference reference, JniHandleOwnership transfer, Func createCleanup) where T : IJavaObject, IJavaObjectEx where TCleanup : IDisposable { - if (handle == null) - throw new ArgumentNullException ("handle"); - if (handle.IsInvalid) - throw new ArgumentException ("handle is invalid.", "handle"); + if (!reference.IsValid) + throw new ArgumentException ("handle is invalid.", nameof (reference)); - bool register = handle is JniAllocObjectRef; + bool register = reference.Flags == JniObjectReferenceFlags.Alloc; - value.SetSafeHandle (handle.NewLocalRef ()); - JniEnvironment.Handles.Dispose (handle, transfer); + value.SetPeerReference (reference.NewLocalRef ()); + JniEnvironment.Handles.Dispose (ref reference, transfer); - value.IdentityHashCode = JniSystem.IdentityHashCode (value.SafeHandle); + value.IdentityHashCode = JniSystem.IdentityHashCode (value.PeerReference); if (register) { RegisterObject (value); Action unregister = () => { UnRegisterObject (value); - using (var g = value.SafeHandle) - value.SetSafeHandle (g.NewLocalRef ()); + var o = value.PeerReference; + value.SetPeerReference (o.NewLocalRef ()); + JniEnvironment.Handles.Dispose (ref o); }; return createCleanup (unregister); } @@ -391,45 +356,49 @@ internal TCleanup SetObjectSafeHandle (T value, JniReferenceSafeHan internal void DisposeObject (T value) where T : IJavaObject, IJavaObjectEx { - if (value.SafeHandle == null || value.SafeHandle.IsInvalid) + var h = value.PeerReference; + if (!h.IsValid) return; if (value.Registered) UnRegisterObject (value); value.Dispose (disposing: true); - value.SafeHandle.Dispose (); - value.SetSafeHandle (null); +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + var lref = value.PeerReference.SafeHandle as JniLocalReference; + if (lref != null && !JniEnvironment.IsHandleValid (lref)) { + // `lref` was created on another thread, and CANNOT be disposed on this thread. + // Just invalidate the reference and move on. + lref.SetHandleAsInvalid (); + } +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES + JniEnvironment.Handles.Dispose (ref h); + value.SetPeerReference (new JniObjectReference ()); GC.SuppressFinalize (value); } internal void TryCollectObject (T value) where T : IJavaObject, IJavaObjectEx { + var h = value.PeerReference; // MUST NOT use SafeHandle.ReferenceType: local refs are tied to a JniEnvironment // and the JniEnvironment's corresponding thread; it's a thread-local value. // Accessing SafeHandle.ReferenceType won't kill anything (so far...), but // instead it always returns JniReferenceType.Invalid. - if (value.SafeHandle == null || value.SafeHandle.IsInvalid || value.SafeHandle is JniLocalReference) { - - if (value.SafeHandle != null) { - value.SafeHandle.Dispose (); - value.SetSafeHandle (null); - } - + if (!h.IsValid || h.Type == JniObjectReferenceType.Local) { value.Dispose (disposing: false); + value.SetPeerReference (new JniObjectReference ()); return; } try { - var h = value.SafeHandle; - bool collected = TryGC (value, ref h);; + bool collected = TryGC (value, ref h); if (collected) { - value.SetSafeHandle (null); + value.SetPeerReference (new JniObjectReference ()); if (value.Registered) UnRegisterObject (value); value.Dispose (disposing: false); } else { - value.SetSafeHandle (h); + value.SetPeerReference (h); GC.ReRegisterForFinalize (value); } } catch (Exception e) { @@ -448,17 +417,17 @@ internal void TryCollectObject (T value) /// The instance to collect. /// /// - /// The of . - /// This value may be updated, and + /// The of . + /// This value may be updated, and /// will be updated with this value. /// - internal protected abstract bool TryGC (IJavaObject value, ref JniReferenceSafeHandle handle); + internal protected abstract bool TryGC (IJavaObject value, ref JniObjectReference handle); - public IJavaObject PeekObject (JniReferenceSafeHandle handle) + public IJavaObject PeekObject (JniObjectReference reference) { - if (handle == null || handle.IsInvalid) + if (!reference.IsValid) return null; - int key = JniSystem.IdentityHashCode (handle); + int key = JniSystem.IdentityHashCode (reference); lock (RegisteredInstances) { WeakReference wv; if (RegisteredInstances.TryGetValue (key, out wv)) { @@ -471,32 +440,45 @@ public IJavaObject PeekObject (JniReferenceSafeHandle handle) return null; } - public IJavaObject GetObject (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType = null) + public IJavaObject GetObject (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType = null) { - if (handle == null || handle.IsInvalid) + if (!reference.IsValid) return null; - var existing = PeekObject (handle); - if (existing != null && targetType != null && targetType.IsInstanceOfType (existing)) + var existing = PeekObject (reference); + if (existing != null && targetType != null && targetType.IsInstanceOfType (existing)) { + JniEnvironment.Handles.Dispose (ref reference, transfer); return existing; + } - return CreateObjectWrapper (handle, transfer, targetType); + return CreateObjectWrapper (ref reference, transfer, targetType); } - protected virtual IJavaObject CreateObjectWrapper (JniReferenceSafeHandle handle, JniHandleOwnership transfer, Type targetType) + protected virtual IJavaObject CreateObjectWrapper (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType) { targetType = targetType ?? typeof (JavaObject); if (!typeof (IJavaObject).IsAssignableFrom (targetType)) throw new ArgumentException ("targetType must implement IJavaObject!", "targetType"); - var bestType = GetWrapperType (handle); - if (targetType != null && targetType.IsAssignableFrom (bestType)) - targetType = bestType; + var ctor = GetWrapperConstructor (reference, targetType); + if (ctor == null) + throw new NotSupportedException (string.Format ("Could not find an appropriate constructable wrapper type for Java type '{0}', targetType='{1}'.", + JniEnvironment.Types.GetJniTypeNameFromInstance (reference), targetType)); - return (IJavaObject)Activator.CreateInstance (targetType, handle, transfer); + var acts = new object[] { + reference, + transfer, + }; + try { + return (IJavaObject) ctor.Invoke (acts); + } finally { + reference = (JniObjectReference) acts [0]; + } } - Type GetWrapperType (JniReferenceSafeHandle instance) + static readonly Type ByRefJniObjectReference = typeof (JniObjectReference).MakeByRefType (); + + ConstructorInfo GetWrapperConstructor (JniObjectReference instance, Type fallbackType) { var klass = JniEnvironment.Types.GetObjectClass (instance); var jniTypeName = JniEnvironment.Types.GetJniTypeNameFromClass (klass); @@ -506,45 +488,45 @@ Type GetWrapperType (JniReferenceSafeHandle instance) type = GetTypeForJniTypeRefererence (jniTypeName); if (type != null) { - const BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance; - var ctors = - from c in type.GetConstructors (bindingFlags) - let p = c.GetParameters () - where p.Length == 2 - where p [0].ParameterType == typeof(JniReferenceSafeHandle) && - p [1].ParameterType == typeof(JniHandleOwnership) - select c; - if (ctors.Any ()) { - klass.Dispose (); - return type; + var ctor = type.GetConstructor (new[] { + ByRefJniObjectReference, + typeof(JniHandleOwnership) + }); + + if (ctor != null) { + JniEnvironment.Handles.Dispose (ref klass); + return ctor; } } var super = JniEnvironment.Types.GetSuperclass (klass); - jniTypeName = (super == null || super.IsClosed || super.IsInvalid) - ? null - : JniEnvironment.Types.GetJniTypeNameFromClass (super); + jniTypeName = super.IsValid + ? JniEnvironment.Types.GetJniTypeNameFromClass (super) + : null; - klass.Dispose (); + JniEnvironment.Handles.Dispose (ref klass, JniHandleOwnership.Transfer); klass = super; } - if (klass != null) - klass.Dispose (); - return null; + JniEnvironment.Handles.Dispose (ref klass, JniHandleOwnership.Transfer); + + return fallbackType.GetConstructor (new[] { + ByRefJniObjectReference, + typeof(JniHandleOwnership) + }); } - public T GetObject (JniReferenceSafeHandle jniHandle, JniHandleOwnership transfer) + public T GetObject (ref JniObjectReference reference, JniHandleOwnership transfer) where T : IJavaObject { - return (T) GetObject (jniHandle, transfer, typeof (T)); + return (T) GetObject (ref reference, transfer, typeof (T)); } public IJavaObject GetObject (IntPtr jniHandle, Type targetType = null) { if (jniHandle == IntPtr.Zero) return null; - using (var h = new JniInvocationHandle (jniHandle)) - return GetObject (h, JniHandleOwnership.DoNotTransfer, targetType); + var h = new JniObjectReference (jniHandle); + return GetObject (ref h, JniHandleOwnership.DoNotTransfer, targetType); } public T GetObject (IntPtr jniHandle) @@ -746,8 +728,8 @@ public virtual JniMarshalInfo GetJniMarshalInfoForType (Type type) } } var arrayType = typeof (JavaObjectArray<>).MakeGenericType (elementType); - var getValue = CreateMethodDelegate> (arrayType, "GetValue"); - var createLRef = CreateMethodDelegate> (arrayType, "CreateLocalRef"); + var getValue = CreateMethodDelegate (arrayType, "GetValue"); + var createLRef = CreateMethodDelegate> (arrayType, "CreateLocalRef"); var createObj = CreateMethodDelegate> (arrayType, "CreateMarshalCollection"); var cleanup = CreateMethodDelegate> (arrayType, "CleanupMarshalCollection"); diff --git a/src/Java.Interop/Java.Interop/JniAllocObjectRef.cs b/src/Java.Interop/Java.Interop/JniAllocObjectRef.cs index 51900b70a..82f3b313a 100644 --- a/src/Java.Interop/Java.Interop/JniAllocObjectRef.cs +++ b/src/Java.Interop/Java.Interop/JniAllocObjectRef.cs @@ -2,7 +2,7 @@ namespace Java.Interop { - class JniAllocObjectRef : JniLocalReference + sealed class JniAllocObjectRef : JniLocalReference { public JniAllocObjectRef (IntPtr handle) { diff --git a/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.cs b/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.cs index 18a306a39..1a50c3477 100644 --- a/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.cs +++ b/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.cs @@ -92,7 +92,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Boolean, "Expected value of type `Boolean`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -104,14 +104,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID booleanValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Boolean), "Expected targetType==typeof(Boolean); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref booleanValue, "booleanValue", "()Z"); try { return booleanValue.CallVirtualBooleanMethod (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -130,7 +130,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is SByte, "Expected value of type `SByte`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -142,14 +142,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID byteValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (SByte), "Expected targetType==typeof(SByte); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref byteValue, "byteValue", "()B"); try { return byteValue.CallVirtualSByteMethod (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -168,7 +168,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Char, "Expected value of type `Char`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -180,14 +180,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID charValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Char), "Expected targetType==typeof(Char); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref charValue, "charValue", "()C"); try { return charValue.CallVirtualCharMethod (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -206,7 +206,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Int16, "Expected value of type `Int16`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -218,14 +218,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID shortValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Int16), "Expected targetType==typeof(Int16); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref shortValue, "shortValue", "()S"); try { return shortValue.CallVirtualInt16Method (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -244,7 +244,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Int32, "Expected value of type `Int32`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -256,14 +256,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID intValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Int32), "Expected targetType==typeof(Int32); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref intValue, "intValue", "()I"); try { return intValue.CallVirtualInt32Method (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -282,7 +282,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Int64, "Expected value of type `Int64`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -294,14 +294,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID longValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Int64), "Expected targetType==typeof(Int64); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref longValue, "longValue", "()J"); try { return longValue.CallVirtualInt64Method (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -320,7 +320,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Single, "Expected value of type `Single`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -332,14 +332,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID floatValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Single), "Expected targetType==typeof(Single); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref floatValue, "floatValue", "()F"); try { return floatValue.CallVirtualSingleMethod (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } @@ -358,7 +358,7 @@ internal static JValue CreateJValue (object value) } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is Double, "Expected value of type `Double`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -370,14 +370,14 @@ internal static unsafe JniLocalReference CreateLocalRef (object value) } static JniInstanceMethodID doubleValue; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (Double), "Expected targetType==typeof(Double); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref doubleValue, "doubleValue", "()D"); try { return doubleValue.CallVirtualDoubleMethod (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } diff --git a/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.tt b/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.tt index 3063f30ca..98d4bebeb 100644 --- a/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.tt +++ b/src/Java.Interop/Java.Interop/JniBuiltinMarshalers.tt @@ -75,7 +75,7 @@ namespace Java.Interop { } static JniInstanceMethodID init; - internal static unsafe JniLocalReference CreateLocalRef (object value) + internal static unsafe JniObjectReference CreateLocalRef (object value) { Debug.Assert (value is <#= type.Type #>, "Expected value of type `<#= type.Type #>`; was: " + (value == null ? "" : value.GetType ().FullName)); @@ -87,14 +87,14 @@ namespace Java.Interop { } static JniInstanceMethodID <#= type.GetValue #>; - internal static object GetValueFromJni (JniReferenceSafeHandle self, JniHandleOwnership transfer, Type targetType) + internal static object GetValueFromJni (ref JniObjectReference self, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == null || targetType == typeof (<#= type.Type #>), "Expected targetType==typeof(<#= type.Type #>); was: " + targetType); TypeRef.GetCachedInstanceMethod (ref <#= type.GetValue #>, "<#= type.GetValue #>", "()<#= type.JniType #>"); try { return <#= type.GetValue #>.CallVirtual<#= type.Type #>Method (self); } finally { - JniEnvironment.Handles.Dispose (self, transfer); + JniEnvironment.Handles.Dispose (ref self, transfer); } } } diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs index 2514fd56d..58dc580c8 100644 --- a/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs +++ b/src/Java.Interop/Java.Interop/JniEnvironment.Errors.cs @@ -16,7 +16,7 @@ public static void Throw (Exception e) // We'll need to rely on the GC to cleanup je.RegisterWithVM (); } - Throw (je.SafeHandle); + Throw (je.PeerReference); } } } diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Handles.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Handles.cs index d917b9c3d..159190ebe 100644 --- a/src/Java.Interop/Java.Interop/JniEnvironment.Handles.cs +++ b/src/Java.Interop/Java.Interop/JniEnvironment.Handles.cs @@ -7,37 +7,58 @@ partial class JniEnvironment { static partial class Handles { - internal static void Dispose (JniReferenceSafeHandle value, JniHandleOwnership transfer) + public static void Dispose (ref JniObjectReference reference) { + Dispose (ref reference, JniHandleOwnership.Transfer); + } + + public static void Dispose (ref JniObjectReference reference, JniHandleOwnership transfer) + { + if (!reference.IsValid) + return; + switch (transfer) { case JniHandleOwnership.DoNotTransfer: break; case JniHandleOwnership.Transfer: - value.Dispose (); + switch (reference.Type) { + case JniObjectReferenceType.Global: + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteGlobalReference (ref reference); + break; + case JniObjectReferenceType.Local: + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteLocalReference (JniEnvironment.Current, ref reference); + break; + case JniObjectReferenceType.WeakGlobal: + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteWeakGlobalReference (ref reference); + break; + default: + throw new NotImplementedException ("Do not know how to dispose: " + reference.Type + "."); + } + reference.Invalidate (); break; default: throw new NotImplementedException ("Do not know how to transfer: " + transfer); } } - public static int GetIdentityHashCode (JniReferenceSafeHandle value) + public static int GetIdentityHashCode (JniObjectReference value) { return JniSystem.IdentityHashCode (value); } public static IntPtr NewReturnToJniRef (IJavaObject value) { - if (value == null) + if (value == null || !value.PeerReference.IsValid) return IntPtr.Zero; - return NewReturnToJniRef (value.SafeHandle); + return NewReturnToJniRef (value.PeerReference); } - public static IntPtr NewReturnToJniRef (JniReferenceSafeHandle value) + public static IntPtr NewReturnToJniRef (JniObjectReference value) { - if (value == null || value.IsInvalid) + if (!value.IsValid) return IntPtr.Zero; - using (var l = value.NewLocalRef ()) - return l.ReturnToJniRef (); + var l = value.NewLocalRef (); + return JniEnvironment.Current.JavaVM.JniHandleManager.ReleaseLocalReference (JniEnvironment.Current, ref l); } } } diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Strings.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Strings.cs index 4be0a44eb..d24cfba4a 100644 --- a/src/Java.Interop/Java.Interop/JniEnvironment.Strings.cs +++ b/src/Java.Interop/Java.Interop/JniEnvironment.Strings.cs @@ -7,15 +7,15 @@ partial class JniEnvironment { partial class Strings { - public static unsafe JniLocalReference NewString (string value) + public static unsafe JniObjectReference NewString (string value) { if (value == null) - return new JniLocalReference (); + return new JniObjectReference (); fixed (char* s = value) return NewString ((IntPtr) s, value.Length); } - internal static JniLocalReference NewString (object value) + internal static JniObjectReference NewString (object value) { Debug.Assert (value == null || (value is string), "Expected value==null or string; was: " + (value ?? "").GetType ().FullName); return NewString ((string) value); @@ -23,13 +23,17 @@ internal static JniLocalReference NewString (object value) public static string ToString (IntPtr handle) { - using (var r = new JniInvocationHandle (handle)) - return ToString (r); + return ToString (new JniObjectReference (handle)); } - public static unsafe string ToString (JniReferenceSafeHandle value, JniHandleOwnership transfer = JniHandleOwnership.DoNotTransfer) + public static unsafe string ToString (JniObjectReference value) { - if (value == null || value.IsInvalid) + return ToString (ref value, JniHandleOwnership.DoNotTransfer); + } + + public static unsafe string ToString (ref JniObjectReference value, JniHandleOwnership transfer) + { + if (!value.IsValid) return null; int len = JniEnvironment.Strings.GetStringLength (value); var p = JniEnvironment.Strings.GetStringChars (value, IntPtr.Zero); @@ -37,14 +41,14 @@ public static unsafe string ToString (JniReferenceSafeHandle value, JniHandleOwn return new string ((char*) p, 0, len); } finally { JniEnvironment.Strings.ReleaseStringChars (value, p); - JniEnvironment.Handles.Dispose (value, transfer); + JniEnvironment.Handles.Dispose (ref value, transfer); } } - internal static unsafe string ToString (JniReferenceSafeHandle value, JniHandleOwnership transfer, Type targetType) + internal static unsafe string ToString (ref JniObjectReference value, JniHandleOwnership transfer, Type targetType) { Debug.Assert (targetType == typeof (string), "Expected targetType==typeof(string); was: " + targetType); - return ToString (value, transfer); + return ToString (ref value, transfer); } } } diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs b/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs index e6dbf77d9..c5d4d6d07 100644 --- a/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs +++ b/src/Java.Interop/Java.Interop/JniEnvironment.Types.cs @@ -20,25 +20,29 @@ static partial class Types { }; - public static JniType GetTypeFromInstance (JniReferenceSafeHandle value) + public static JniType GetTypeFromInstance (JniObjectReference reference) { - var lref = JniEnvironment.Types.GetObjectClass (value); - if (!lref.IsInvalid) - return new JniType (lref, JniHandleOwnership.Transfer); + var lref = JniEnvironment.Types.GetObjectClass (reference); + if (lref.IsValid) + return new JniType (ref lref, JniHandleOwnership.Transfer); return null; } - public static string GetJniTypeNameFromInstance (JniReferenceSafeHandle handle) + public static string GetJniTypeNameFromInstance (JniObjectReference reference) { - using (var c = GetObjectClass (handle)) { - return GetJniTypeNameFromClass (c); + var lref = GetObjectClass (reference); + try { + return GetJniTypeNameFromClass (lref); + } + finally { + JniEnvironment.Handles.Dispose (ref lref, JniHandleOwnership.Transfer); } } - public static string GetJniTypeNameFromClass (JniReferenceSafeHandle handle) + public static string GetJniTypeNameFromClass (JniObjectReference reference) { - var s = JniEnvironment.Current.Class_getName.CallVirtualObjectMethod (handle); - return JavaClassToJniType (Strings.ToString (s, JniHandleOwnership.Transfer)); + var s = JniEnvironment.Current.Class_getName.CallVirtualObjectMethod (reference); + return JavaClassToJniType (Strings.ToString (ref s, JniHandleOwnership.Transfer)); } static string JavaClassToJniType (string value) diff --git a/src/Java.Interop/Java.Interop/JniEnvironment.cs b/src/Java.Interop/Java.Interop/JniEnvironment.cs index c70ee261a..32d816a73 100644 --- a/src/Java.Interop/Java.Interop/JniEnvironment.cs +++ b/src/Java.Interop/Java.Interop/JniEnvironment.cs @@ -7,44 +7,10 @@ namespace Java.Interop { - public sealed class JniEnvironmentSafeHandle : SafeHandle - { - JniEnvironmentSafeHandle () - : base (IntPtr.Zero, ownsHandle:false) - { - } - - public JniEnvironmentSafeHandle (IntPtr handle) - : this () - { - SetHandle (handle); - } - - public override bool IsInvalid { - get {return handle == IntPtr.Zero;} - } - - protected override bool ReleaseHandle () - { - return false; - } - - internal unsafe JniEnvironmentInvoker CreateInvoker () - { - IntPtr p = Marshal.ReadIntPtr (handle); - return new JniEnvironmentInvoker ((JniNativeInterfaceStruct*) p); - } - - public override string ToString () - { - return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); - } - } - public sealed partial class JniEnvironment : IDisposable { [ThreadStatic] - static JniEnvironmentSafeHandle handle; + static IntPtr envHandle; [ThreadStatic] static JniEnvironment current; @@ -54,11 +20,12 @@ public sealed partial class JniEnvironment : IDisposable { bool disposed; Exception pendingException; - internal JniEnvironment (JniEnvironmentSafeHandle safeHandle, JavaVM javaVM) + internal JniEnvironment (IntPtr handle, JavaVM javaVM) { - handle = safeHandle; + envHandle = handle; + vm = javaVM; - Invoker = SafeHandle.CreateInvoker (); + Invoker = CreateInvoker (handle); previous = current; current = this; @@ -69,23 +36,21 @@ public JniEnvironment (IntPtr jniEnvironmentHandle) { } - static JniEnvironmentSafeHandle GetCurrentHandle (IntPtr jniEnvironmentHandle) + static IntPtr GetCurrentHandle (IntPtr jniEnvironmentHandle) { - if (handle == null) - return new JniEnvironmentSafeHandle (jniEnvironmentHandle); - - if (handle.DangerousGetHandle () == jniEnvironmentHandle) - return handle; - - handle.Dispose (); - handle = null; - return new JniEnvironmentSafeHandle (jniEnvironmentHandle); + return jniEnvironmentHandle; } internal JniEnvironmentInvoker Invoker; - public JniEnvironmentSafeHandle SafeHandle { - get {return handle ?? RootEnvironment.SafeHandle;} + static unsafe JniEnvironmentInvoker CreateInvoker (IntPtr handle) + { + IntPtr p = Marshal.ReadIntPtr (handle); + return new JniEnvironmentInvoker ((JniNativeInterfaceStruct*) p); + } + + public IntPtr EnvironmentPointer { + get {return envHandle != IntPtr.Zero ? envHandle : RootEnvironment.EnvironmentPointer;} } public JavaVM JavaVM { @@ -93,8 +58,8 @@ public JavaVM JavaVM { if (vm != null) return vm; - JavaVMSafeHandle vmh; - int r = Invoker.GetJavaVM (SafeHandle, out vmh); + IntPtr vmh; + int r = Invoker.GetJavaVM (EnvironmentPointer, out vmh); if (r < 0) throw new InvalidOperationException ("JNIEnv::GetJavaVM() returned: " + r); @@ -102,7 +67,7 @@ public JavaVM JavaVM { if (vm == null) throw new NotSupportedException ( string.Format ("No JavaVM registered with handle 0x{0}.", - vmh.DangerousGetHandle ().ToString ("x"))); + vmh.ToString ("x"))); return vm; } @@ -115,7 +80,7 @@ internal List LocalReferences { internal static bool IsHandleValid (JniLocalReference lref) { - if (lref == null) + if (lref == null || lref.IsInvalid || lref.IsClosed) return false; var e = JniEnvironment.Current; @@ -161,11 +126,12 @@ public void SetPendingException (Exception e) public void Dispose () { - if (disposed || handle == null || handle.IsInvalid) + if (disposed || envHandle == IntPtr.Zero) return; disposed = true; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES if (lrefs != null) { // Copy required as lref.Dispose() calls DeleteLocalReference(), alters lrefs. var refs = lrefs.ToList (); @@ -176,19 +142,17 @@ public void Dispose () } lrefs = null; } +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES if (pendingException != null) Errors.Throw (pendingException); - if (Obj_toS != null) - Obj_toS.Dispose (); - if (Cls_getN != null) - Cls_getN.Dispose (); + Obj_toS = null; + Cls_getN = null; if ((previous == null && !RootEnvironments.IsValueCreated) || (RootEnvironments.IsValueCreated && RootEnvironment == this)) { - handle.Dispose (); - handle = null; + envHandle = IntPtr.Zero; RootEnvironments.Value = null; } @@ -211,13 +175,22 @@ public int LocalReferenceCount { } } - internal void LogCreateLocalRef (JniLocalReference value) + internal void LogCreateLocalRef (JniObjectReference value) { - if (value == null || value.IsInvalid) + if (!value.IsValid) return; JavaVM.JniHandleManager.CreatedLocalReference (this, value); } +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + internal void LogCreateLocalRef (JniLocalReference value) + { + if (value == null || value.IsInvalid || value.IsClosed) + return; + var r = new JniObjectReference (value, JniObjectReferenceType.Local); + LogCreateLocalRef (r); + } + internal void DeleteLocalReference (JniLocalReference value, IntPtr handle) { var c = current; @@ -235,8 +208,11 @@ internal void DeleteLocalReference (JniLocalReference value, IntPtr handle) return; } c.lrefs.Remove (value); - JniEnvironment.Current.JavaVM.JniHandleManager.DeleteLocalReference (this, handle); + var r = new JniObjectReference (value, JniObjectReferenceType.Local); + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteLocalReference (this, ref r); + value.SetHandleAsInvalid (); } +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES JniInstanceMethodID Obj_toS; internal JniInstanceMethodID Object_toString { @@ -265,14 +241,13 @@ internal JniInstanceMethodID Class_getName { public Exception GetExceptionForLastThrowable () { - using (var e = JniEnvironment.Errors.ExceptionOccurred ()) { - if (e == null || e.IsInvalid) - return null; - // JniEnvironment.Errors.ExceptionDescribe (); - JniEnvironment.Errors.ExceptionClear (); - JniEnvironment.Current.LogCreateLocalRef (e); - return JavaVM.GetExceptionForThrowable (e, JniHandleOwnership.Transfer); - } + var e = JniEnvironment.Errors.ExceptionOccurred (); + if (!e.IsValid) + return null; + // JniEnvironment.Errors.ExceptionDescribe (); + JniEnvironment.Errors.ExceptionClear (); + JniEnvironment.Current.LogCreateLocalRef (e); + return JavaVM.GetExceptionForThrowable (ref e, JniHandleOwnership.Transfer); } } } diff --git a/src/Java.Interop/Java.Interop/JniFieldID.cs b/src/Java.Interop/Java.Interop/JniFieldID.cs index 746f2ca3a..158463175 100644 --- a/src/Java.Interop/Java.Interop/JniFieldID.cs +++ b/src/Java.Interop/Java.Interop/JniFieldID.cs @@ -1,32 +1,23 @@ using System; -using System.Runtime.InteropServices; namespace Java.Interop { - public abstract class JniFieldID : SafeHandle + public abstract class JniFieldID { - internal JniFieldID () - : base (IntPtr.Zero, true) - { - JniEnvironment.Current.JavaVM.TrackID (this, this); - } + public IntPtr ID {get; private set;} - protected override bool ReleaseHandle () - { - if (JniEnvironment.HasCurrent) - JniEnvironment.Current.JavaVM.UnTrack (this); - return true; + internal bool IsValid { + get {return ID != IntPtr.Zero;} } - public override bool IsInvalid { - get { - return handle == IntPtr.Zero; - } + internal JniFieldID (IntPtr fieldID) + { + ID = fieldID; } public override string ToString () { - return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); } } } diff --git a/src/Java.Interop/Java.Interop/JniGlobalReference.cs b/src/Java.Interop/Java.Interop/JniGlobalReference.cs index e99c29d53..6311eb81a 100644 --- a/src/Java.Interop/Java.Interop/JniGlobalReference.cs +++ b/src/Java.Interop/Java.Interop/JniGlobalReference.cs @@ -2,16 +2,30 @@ using System.Diagnostics; using System.Runtime.InteropServices; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + namespace Java.Interop { + sealed class JniGlobalReference : JniReferenceSafeHandle { + + public JniGlobalReference () + { + } + + public JniGlobalReference (IntPtr handle) + { + SetHandle (handle); + } - public class JniGlobalReference : JniReferenceSafeHandle { protected override bool ReleaseHandle () { - if (JniEnvironment.HasCurrent) - JniEnvironment.Current.JavaVM.JniHandleManager.DeleteGlobalReference (handle); + if (JniEnvironment.HasCurrent) { + var r = new JniObjectReference (this, JniObjectReferenceType.Global); + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteGlobalReference (ref r); + } return true; } } - } + +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES diff --git a/src/Java.Interop/Java.Interop/JniHandleManager.cs b/src/Java.Interop/Java.Interop/JniHandleManager.cs index 47f8f9e3e..a59abede2 100644 --- a/src/Java.Interop/Java.Interop/JniHandleManager.cs +++ b/src/Java.Interop/Java.Interop/JniHandleManager.cs @@ -25,79 +25,87 @@ public void WriteLocalReferenceLine (string format, params object[] args) { } - public JniLocalReference CreateLocalReference (JniEnvironment environment, JniReferenceSafeHandle value) + public JniObjectReference CreateLocalReference (JniEnvironment environment, JniObjectReference reference) { - if (value == null || value.IsInvalid) - return null; - AssertCount (environment.LrefCount, "LREF", value.DangerousGetHandle ()); + if (!reference.IsValid) + return reference; + AssertCount (environment.LrefCount, "LREF", reference.ToString ()); environment.LrefCount++; - return JniEnvironment.Handles.NewLocalRef (value); + return JniEnvironment.Handles.NewLocalRef (reference); } - public void DeleteLocalReference (JniEnvironment environment, IntPtr value) + public void DeleteLocalReference (JniEnvironment environment, ref JniObjectReference reference) { - if (value == IntPtr.Zero) + if (!reference.IsValid) return; - AssertCount (environment.LrefCount, "LREF", value); + AssertReferenceType (ref reference, JniObjectReferenceType.Local); + AssertCount (environment.LrefCount, "LREF", reference.ToString ()); environment.LrefCount--; - JniEnvironment.Handles.DeleteLocalRef (value); + JniEnvironment.Handles.DeleteLocalRef (reference.Handle); + reference.Invalidate (); } - public void CreatedLocalReference (JniEnvironment environment, JniLocalReference value) + public void CreatedLocalReference (JniEnvironment environment, JniObjectReference reference) { - if (value == null || value.IsInvalid) + if (!reference.IsValid) return; - AssertCount (environment.LrefCount, "LREF", value.DangerousGetHandle ()); + AssertCount (environment.LrefCount, "LREF", reference.ToString ()); environment.LrefCount++ ; } - public IntPtr ReleaseLocalReference (JniEnvironment environment, JniLocalReference value) + public IntPtr ReleaseLocalReference (JniEnvironment environment, ref JniObjectReference reference) { - if (value == null || value.IsInvalid) + if (!reference.IsValid) return IntPtr.Zero; - AssertCount (environment.LrefCount, "LREF", value.DangerousGetHandle ()); + AssertCount (environment.LrefCount, "LREF", reference.ToString ()); environment.LrefCount--; - return value._GetAndClearHandle (); + var h = reference.Handle; + reference.Invalidate (); + return h; } public void WriteGlobalReferenceLine (string format, params object[] args) { } - public JniGlobalReference CreateGlobalReference (JniReferenceSafeHandle value) + public JniObjectReference CreateGlobalReference (JniObjectReference reference) { - if (value == null || value.IsInvalid) - return null; - AssertCount (grefc, "GREF", value.DangerousGetHandle ()); + if (!reference.IsValid) + return reference; + AssertCount (grefc, "GREF", reference.ToString ()); Interlocked.Increment (ref grefc); - return JniEnvironment.Handles.NewGlobalRef (value); + return JniEnvironment.Handles.NewGlobalRef (reference); } - public void DeleteGlobalReference (IntPtr value) + public void DeleteGlobalReference (ref JniObjectReference reference) { - if (value == IntPtr.Zero) + if (!reference.IsValid) return; - AssertCount (grefc, "GREF", value); + AssertReferenceType (ref reference, JniObjectReferenceType.Global); + AssertCount (grefc, "GREF", reference.ToString ()); Interlocked.Decrement (ref grefc); - JniEnvironment.Handles.DeleteGlobalRef (value); + JniEnvironment.Handles.DeleteGlobalRef (reference.Handle); + reference.Invalidate (); } - public JniWeakGlobalReference CreateWeakGlobalReference (JniReferenceSafeHandle value) + public JniObjectReference CreateWeakGlobalReference (JniObjectReference reference) { - if (value == null || value.IsInvalid) - return null; - AssertCount (wgrefc, "WGREF", value.DangerousGetHandle ()); + if (!reference.IsValid) + return reference; + AssertCount (wgrefc, "WGREF", reference.ToString ()); Interlocked.Increment (ref wgrefc); - return JniEnvironment.Handles.NewWeakGlobalRef (value); + return JniEnvironment.Handles.NewWeakGlobalRef (reference); } - public void DeleteWeakGlobalReference (IntPtr value) + public void DeleteWeakGlobalReference (ref JniObjectReference reference) { - if (value == IntPtr.Zero) + if (!reference.IsValid) return; - AssertCount (wgrefc, "WGREF", value); + AssertReferenceType (ref reference, JniObjectReferenceType.WeakGlobal); + AssertCount (wgrefc, "WGREF", reference.ToString ()); Interlocked.Decrement (ref wgrefc); - JniEnvironment.Handles.DeleteWeakGlobalRef (value); + JniEnvironment.Handles.DeleteWeakGlobalRef (reference.Handle); + reference.Invalidate (); } public void Dispose () @@ -105,11 +113,19 @@ public void Dispose () } [Conditional ("DEBUG")] - static void AssertCount (int count, string type, IntPtr value) + static void AssertReferenceType (ref JniObjectReference reference, JniObjectReferenceType type) + { + Debug.Assert (reference.Type == type, + string.Format ("Object reference {0} should be of type {1}, is instead {2}!", + reference.ToString (), type, reference.Type)); + } + + [Conditional ("DEBUG")] + static void AssertCount (int count, string type, string value) { Debug.Assert (count >= 0, - string.Format ("{0} count is {1}, expected to be >= 0 when dealing with handle 0x{2} on thread {3}", - type, count, value.ToString ("x"), Thread.CurrentThread.ManagedThreadId)); + string.Format ("{0} count is {1}, expected to be >= 0 when dealing with handle {2} on thread {3}", + type, count, value, Thread.CurrentThread.ManagedThreadId)); } } } diff --git a/src/Java.Interop/Java.Interop/JniHandleOwnership.cs b/src/Java.Interop/Java.Interop/JniHandleOwnership.cs index 0426aa454..a8edf7f07 100644 --- a/src/Java.Interop/Java.Interop/JniHandleOwnership.cs +++ b/src/Java.Interop/Java.Interop/JniHandleOwnership.cs @@ -2,10 +2,19 @@ namespace Java.Interop { - public enum JniHandleOwnership + [Flags] + public enum JniHandleOwnership // JniObjectReferenceOptions { DoNotTransfer = 0, Transfer = 1, + Invalid = 2, + + /* + Invalid = 0, + CreateNewReference = 1, // DoNotTransfer + DisposeSourceReference = 2, // Transfer + Unregistered = 4, + */ } } diff --git a/src/Java.Interop/Java.Interop/JniInstanceFieldID.cs b/src/Java.Interop/Java.Interop/JniInstanceFieldID.cs index 5515e0598..bf1040720 100644 --- a/src/Java.Interop/Java.Interop/JniInstanceFieldID.cs +++ b/src/Java.Interop/Java.Interop/JniInstanceFieldID.cs @@ -5,96 +5,97 @@ namespace Java.Interop { public sealed class JniInstanceFieldID : JniFieldID { - JniInstanceFieldID () + internal JniInstanceFieldID (IntPtr fieldID) + : base (fieldID) { } - public JniLocalReference GetObjectValue (JniReferenceSafeHandle @this) + public JniObjectReference GetObjectValue (JniObjectReference @this) { return JniEnvironment.Members.GetObjectField (@this, this); } - public bool GetBooleanValue (JniReferenceSafeHandle @this) + public bool GetBooleanValue (JniObjectReference @this) { return JniEnvironment.Members.GetBooleanField (@this, this); } - public sbyte GetByteValue (JniReferenceSafeHandle @this) + public sbyte GetByteValue (JniObjectReference @this) { return JniEnvironment.Members.GetByteField (@this, this); } - public char GetCharValue (JniReferenceSafeHandle @this) + public char GetCharValue (JniObjectReference @this) { return JniEnvironment.Members.GetCharField (@this, this); } - public short GetInt16Value (JniReferenceSafeHandle @this) + public short GetInt16Value (JniObjectReference @this) { return JniEnvironment.Members.GetShortField (@this, this); } - public int GetInt32Value (JniReferenceSafeHandle @this) + public int GetInt32Value (JniObjectReference @this) { return JniEnvironment.Members.GetIntField (@this, this); } - public long GetInt64Value (JniReferenceSafeHandle @this) + public long GetInt64Value (JniObjectReference @this) { return JniEnvironment.Members.GetLongField (@this, this); } - public float GetSingleValue (JniReferenceSafeHandle @this) + public float GetSingleValue (JniObjectReference @this) { return JniEnvironment.Members.GetFloatField (@this, this); } - public double GetDoubleValue (JniReferenceSafeHandle @this) + public double GetDoubleValue (JniObjectReference @this) { return JniEnvironment.Members.GetDoubleField (@this, this); } - public void SetValue (JniReferenceSafeHandle @this, JniReferenceSafeHandle value) + public void SetValue (JniObjectReference @this, JniObjectReference value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, bool value) + public void SetValue (JniObjectReference @this, bool value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, sbyte value) + public void SetValue (JniObjectReference @this, sbyte value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, char value) + public void SetValue (JniObjectReference @this, char value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, short value) + public void SetValue (JniObjectReference @this, short value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, int value) + public void SetValue (JniObjectReference @this, int value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, long value) + public void SetValue (JniObjectReference @this, long value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, float value) + public void SetValue (JniObjectReference @this, float value) { JniEnvironment.Members.SetField (@this, this, value); } - public void SetValue (JniReferenceSafeHandle @this, double value) + public void SetValue (JniObjectReference @this, double value) { JniEnvironment.Members.SetField (@this, this, value); } diff --git a/src/Java.Interop/Java.Interop/JniInstanceMethodID.cs b/src/Java.Interop/Java.Interop/JniInstanceMethodID.cs index da5c1b086..b8c363810 100644 --- a/src/Java.Interop/Java.Interop/JniInstanceMethodID.cs +++ b/src/Java.Interop/Java.Interop/JniInstanceMethodID.cs @@ -5,206 +5,207 @@ namespace Java.Interop { public sealed class JniInstanceMethodID : JniMethodID { - JniInstanceMethodID () + internal JniInstanceMethodID (IntPtr methodID) + : base (methodID) { } - public void CallVirtualVoidMethod (JniReferenceSafeHandle @this) + public void CallVirtualVoidMethod (JniObjectReference @this) { JniEnvironment.Members.CallVoidMethod (@this, this); } - public unsafe void CallVirtualVoidMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe void CallVirtualVoidMethod (JniObjectReference @this, JValue* parameters) { JniEnvironment.Members.CallVoidMethod (@this, this, parameters); } - public JniLocalReference CallVirtualObjectMethod (JniReferenceSafeHandle @this) + public JniObjectReference CallVirtualObjectMethod (JniObjectReference @this) { return JniEnvironment.Members.CallObjectMethod (@this, this); } - public unsafe JniLocalReference CallVirtualObjectMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe JniObjectReference CallVirtualObjectMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallObjectMethod (@this, this, parameters); } - public bool CallVirtualBooleanMethod (JniReferenceSafeHandle @this) + public bool CallVirtualBooleanMethod (JniObjectReference @this) { return JniEnvironment.Members.CallBooleanMethod (@this, this); } - public unsafe bool CallVirtualBooleanMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe bool CallVirtualBooleanMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallBooleanMethod (@this, this, parameters); } - public sbyte CallVirtualSByteMethod (JniReferenceSafeHandle @this) + public sbyte CallVirtualSByteMethod (JniObjectReference @this) { return JniEnvironment.Members.CallSByteMethod (@this, this); } - public unsafe sbyte CallVirtualSByteMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe sbyte CallVirtualSByteMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallSByteMethod (@this, this, parameters); } - public char CallVirtualCharMethod (JniReferenceSafeHandle @this) + public char CallVirtualCharMethod (JniObjectReference @this) { return JniEnvironment.Members.CallCharMethod (@this, this); } - public unsafe char CallVirtualCharMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe char CallVirtualCharMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallCharMethod (@this, this, parameters); } - public short CallVirtualInt16Method (JniReferenceSafeHandle @this) + public short CallVirtualInt16Method (JniObjectReference @this) { return JniEnvironment.Members.CallShortMethod (@this, this); } - public unsafe short CallVirtualInt16Method (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe short CallVirtualInt16Method (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallShortMethod (@this, this, parameters); } - public int CallVirtualInt32Method (JniReferenceSafeHandle @this) + public int CallVirtualInt32Method (JniObjectReference @this) { return JniEnvironment.Members.CallIntMethod (@this, this); } - public unsafe int CallVirtualInt32Method (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe int CallVirtualInt32Method (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallIntMethod (@this, this, parameters); } - public long CallVirtualInt64Method (JniReferenceSafeHandle @this) + public long CallVirtualInt64Method (JniObjectReference @this) { return JniEnvironment.Members.CallLongMethod (@this, this); } - public unsafe long CallVirtualInt64Method (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe long CallVirtualInt64Method (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallLongMethod (@this, this, parameters); } - public float CallVirtualSingleMethod (JniReferenceSafeHandle @this) + public float CallVirtualSingleMethod (JniObjectReference @this) { return JniEnvironment.Members.CallFloatMethod (@this, this); } - public unsafe float CallVirtualSingleMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe float CallVirtualSingleMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallFloatMethod (@this, this, parameters); } - public double CallVirtualDoubleMethod (JniReferenceSafeHandle @this) + public double CallVirtualDoubleMethod (JniObjectReference @this) { return JniEnvironment.Members.CallDoubleMethod (@this, this); } - public unsafe double CallVirtualDoubleMethod (JniReferenceSafeHandle @this, JValue* parameters) + public unsafe double CallVirtualDoubleMethod (JniObjectReference @this, JValue* parameters) { return JniEnvironment.Members.CallDoubleMethod (@this, this, parameters); } - public void CallNonvirtualVoidMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public void CallNonvirtualVoidMethod (JniObjectReference @this, JniObjectReference declaringType) { JniEnvironment.Members.CallNonvirtualVoidMethod (@this, declaringType, this); } - public unsafe void CallNonvirtualVoidMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe void CallNonvirtualVoidMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { JniEnvironment.Members.CallNonvirtualVoidMethod (@this, declaringType, this, parameters); } - public JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public JniObjectReference CallNonvirtualObjectMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualObjectMethod (@this, declaringType, this); } - public unsafe JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualObjectMethod (@this, declaringType, this, parameters); } - public bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public bool CallNonvirtualBooleanMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualBooleanMethod (@this, declaringType, this); } - public unsafe bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe bool CallNonvirtualBooleanMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualBooleanMethod (@this, declaringType, this, parameters); } - public sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public sbyte CallNonvirtualSByteMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualSByteMethod (@this, declaringType, this); } - public unsafe sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe sbyte CallNonvirtualSByteMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualSByteMethod (@this, declaringType, this, parameters); } - public char CallNonvirtualCharMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public char CallNonvirtualCharMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualCharMethod (@this, declaringType, this); } - public unsafe char CallNonvirtualCharMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe char CallNonvirtualCharMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualCharMethod (@this, declaringType, this, parameters); } - public short CallNonvirtualInt16Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public short CallNonvirtualInt16Method (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualShortMethod (@this, declaringType, this); } - public unsafe short CallNonvirtualInt16Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe short CallNonvirtualInt16Method (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualShortMethod (@this, declaringType, this, parameters); } - public int CallNonvirtualInt32Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public int CallNonvirtualInt32Method (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualIntMethod (@this, declaringType, this); } - public unsafe int CallNonvirtualInt32Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe int CallNonvirtualInt32Method (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualIntMethod (@this, declaringType, this, parameters); } - public long CallNonvirtualInt64Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public long CallNonvirtualInt64Method (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualLongMethod (@this, declaringType, this); } - public unsafe long CallNonvirtualInt64Method (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe long CallNonvirtualInt64Method (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualLongMethod (@this, declaringType, this, parameters); } - public float CallNonvirtualSingleMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public float CallNonvirtualSingleMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualFloatMethod (@this, declaringType, this); } - public unsafe float CallNonvirtualSingleMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe float CallNonvirtualSingleMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualFloatMethod (@this, declaringType, this, parameters); } - public double CallNonvirtualDoubleMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType) + public double CallNonvirtualDoubleMethod (JniObjectReference @this, JniObjectReference declaringType) { return JniEnvironment.Members.CallNonvirtualDoubleMethod (@this, declaringType, this); } - public unsafe double CallNonvirtualDoubleMethod (JniReferenceSafeHandle @this, JniReferenceSafeHandle declaringType, JValue* parameters) + public unsafe double CallNonvirtualDoubleMethod (JniObjectReference @this, JniObjectReference declaringType, JValue* parameters) { return JniEnvironment.Members.CallNonvirtualDoubleMethod (@this, declaringType, this, parameters); } diff --git a/src/Java.Interop/Java.Interop/JniLocalReference.cs b/src/Java.Interop/Java.Interop/JniLocalReference.cs index 9bc3ad058..09ed3fd38 100644 --- a/src/Java.Interop/Java.Interop/JniLocalReference.cs +++ b/src/Java.Interop/Java.Interop/JniLocalReference.cs @@ -4,14 +4,18 @@ namespace Java.Interop { - - public class JniLocalReference : JniReferenceSafeHandle { + class JniLocalReference : JniReferenceSafeHandle { internal JniLocalReference () { JniEnvironment.Current.LocalReferences.Add (this); } + public JniLocalReference (IntPtr handle) + { + SetHandle (handle); + } + protected override bool ReleaseHandle () { JniEnvironment.Current.DeleteLocalReference (this, handle); @@ -20,7 +24,8 @@ protected override bool ReleaseHandle () internal IntPtr ReturnToJniRef () { - return JniEnvironment.Current.JavaVM.JniHandleManager.ReleaseLocalReference (JniEnvironment.Current, this); + var r = new JniObjectReference (this, JniObjectReferenceType.Local); + return JniEnvironment.Current.JavaVM.JniHandleManager.ReleaseLocalReference (JniEnvironment.Current, ref r); } internal JniAllocObjectRef ToAllocObjectRef () diff --git a/src/Java.Interop/Java.Interop/JniMarshal.cs b/src/Java.Interop/Java.Interop/JniMarshal.cs index 765488aa0..a1e19a642 100644 --- a/src/Java.Interop/Java.Interop/JniMarshal.cs +++ b/src/Java.Interop/Java.Interop/JniMarshal.cs @@ -38,40 +38,40 @@ public static bool RecursiveEquals (object objA, object objB) return false; } - internal static T GetValue (JniReferenceSafeHandle handle, JniHandleOwnership transfer) + internal static T GetValue (ref JniObjectReference reference, JniHandleOwnership transfer) { - if (handle == null || handle.IsInvalid) + if (!reference.IsValid) return default (T); var jvm = JniEnvironment.Current.JavaVM; - var target = jvm.PeekObject (handle); + var target = jvm.PeekObject (reference); var proxy = target as JavaProxyObject; if (proxy != null) { - JniEnvironment.Handles.Dispose (handle, transfer); + JniEnvironment.Handles.Dispose (ref reference, transfer); return (T) proxy.Value; } if (target is T) { - JniEnvironment.Handles.Dispose (handle, transfer); + JniEnvironment.Handles.Dispose (ref reference, transfer); return (T) target; } var info = jvm.GetJniMarshalInfoForType (typeof (T)); if (info.GetValueFromJni != null) { - return (T) info.GetValueFromJni (handle, transfer, typeof (T)); + return (T) info.GetValueFromJni (ref reference, transfer, typeof (T)); } - var targetType = jvm.GetTypeForJniTypeRefererence (handle.GetJniTypeName ()); + var targetType = jvm.GetTypeForJniTypeRefererence (JniEnvironment.Types.GetJniTypeNameFromInstance (reference)); if (targetType != null && typeof (T).IsAssignableFrom (targetType) && (info = jvm.GetJniMarshalInfoForType (targetType)).GetValueFromJni != null) { - return (T) info.GetValueFromJni (handle, transfer, targetType); + return (T) info.GetValueFromJni (ref reference, transfer, targetType); } - return (T) jvm.GetObject (handle, transfer, typeof (T)); + return (T) jvm.GetObject (ref reference, transfer, typeof (T)); } - public static JniLocalReference CreateLocalRef (T value) + public static JniObjectReference CreateLocalRef (T value) { var jvm = JniEnvironment.Current.JavaVM; diff --git a/src/Java.Interop/Java.Interop/JniMarshalInfo.cs b/src/Java.Interop/Java.Interop/JniMarshalInfo.cs index 5b47acb54..fbde06c1b 100644 --- a/src/Java.Interop/Java.Interop/JniMarshalInfo.cs +++ b/src/Java.Interop/Java.Interop/JniMarshalInfo.cs @@ -2,15 +2,16 @@ namespace Java.Interop { - using GetValueFromJniHandler = Func; using CreateJValueHandler = Func; - using CreateLocalRefHandler = Func; + using CreateLocalRefHandler = Func; using CreateMarshalCollectionHandler = Func; using CleanupMarshalCollectionHandler = Action; + public delegate object CreateValueFromJni (ref JniObjectReference reference, JniHandleOwnership transfer, Type targetType); + public struct JniMarshalInfo { - public GetValueFromJniHandler GetValueFromJni; + public CreateValueFromJni GetValueFromJni; public CreateJValueHandler CreateJValue; public CreateLocalRefHandler CreateLocalRef; public CreateMarshalCollectionHandler CreateMarshalCollection; diff --git a/src/Java.Interop/Java.Interop/JniMethodID.cs b/src/Java.Interop/Java.Interop/JniMethodID.cs index 0bb97f0f2..4b6726c9b 100644 --- a/src/Java.Interop/Java.Interop/JniMethodID.cs +++ b/src/Java.Interop/Java.Interop/JniMethodID.cs @@ -3,30 +3,22 @@ namespace Java.Interop { - public abstract class JniMethodID : SafeHandle + public abstract class JniMethodID { - internal JniMethodID () - : base (IntPtr.Zero, true) - { - JniEnvironment.Current.JavaVM.TrackID (this, this); - } + public IntPtr ID {get; private set;} - protected override bool ReleaseHandle () - { - if (JniEnvironment.HasCurrent) - JniEnvironment.Current.JavaVM.UnTrack (this); - return true; + internal bool IsValid { + get {return ID != IntPtr.Zero;} } - public override bool IsInvalid { - get { - return handle == IntPtr.Zero; - } + internal JniMethodID (IntPtr methodID) + { + ID = methodID; } public override string ToString () { - return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + return string.Format ("{0}(0x{1})", GetType ().FullName, ID.ToString ("x")); } } } diff --git a/src/Java.Interop/Java.Interop/JniObjectReference.cs b/src/Java.Interop/Java.Interop/JniObjectReference.cs new file mode 100644 index 000000000..5f79c69d7 --- /dev/null +++ b/src/Java.Interop/Java.Interop/JniObjectReference.cs @@ -0,0 +1,151 @@ +using System; +using System.Runtime.InteropServices; + +namespace Java.Interop +{ + enum JniObjectReferenceFlags : uint { + None, + Alloc = 1 << 16, + } + + public struct JniObjectReference : IEquatable + { + const uint FlagsMask = 0xFFFF0000; + const uint TypeMask = 0x0000FFFF; + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + JniReferenceSafeHandle safeHandle; + internal JniReferenceSafeHandle SafeHandle { + get {return safeHandle ?? JniReferenceSafeHandle.Null;} + } + public IntPtr Handle { + get { + var h = safeHandle; + return h == null + ? IntPtr.Zero + : h.DangerousGetHandle (); + } + } +#elif FEATURE_HANDLES_ARE_INTPTRS + public IntPtr Handle {get; private set;} +#endif + + uint referenceInfo; + + public JniObjectReferenceType Type { + get {return (JniObjectReferenceType) (referenceInfo & TypeMask);} + private set {referenceInfo = (uint) value;} + } + + internal JniObjectReferenceFlags Flags { + get {return (JniObjectReferenceFlags) (referenceInfo & FlagsMask);} + set {referenceInfo |= (((uint) value) & FlagsMask);} + } + + public bool IsValid { + get { +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + return SafeHandle != null && !SafeHandle.IsInvalid && !SafeHandle.IsClosed; +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES +#if FEATURE_HANDLES_ARE_INTPTRS + return Handle == IntPtr.Zero; +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES + } + } + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + internal JniObjectReference (JniReferenceSafeHandle handle, JniObjectReferenceType type = JniObjectReferenceType.Invalid) + { + safeHandle = handle; + referenceInfo = (uint) type; + } +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES + + public JniObjectReference (IntPtr handle, JniObjectReferenceType type = JniObjectReferenceType.Invalid) + { + referenceInfo = (uint) type; + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + if (handle == IntPtr.Zero) { + safeHandle = JniReferenceSafeHandle.Null; + return; + } + switch (type) { + case JniObjectReferenceType.Local: + safeHandle = new JniLocalReference (handle); + break; + case JniObjectReferenceType.Global: + safeHandle = new JniGlobalReference (handle); + break; + case JniObjectReferenceType.WeakGlobal: + safeHandle = new JniWeakGlobalReference (handle); + break; + default: + safeHandle = new JniInvocationHandle (handle); + break; + } +#elif FEATURE_HANDLES_ARE_INTPTRS + Handle = handle; +#endif + } + + public override int GetHashCode () + { + return Handle.GetHashCode (); + } + + public override bool Equals (object value) + { + var o = value as JniObjectReference?; + if (o.HasValue) + return Equals (o.Value); + return false; + } + + public bool Equals (JniObjectReference value) + { +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + return object.ReferenceEquals (SafeHandle, value.SafeHandle); +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES +#if FEATURE_HANDLES_ARE_INTPTRS + return Handle == value.Handle; +#endif // FEATURE_HANDLES_ARE_INTPTRS + } + + public JniObjectReference NewGlobalRef () + { + return JniEnvironment.Current.JavaVM.JniHandleManager.CreateGlobalReference (this); + } + + public JniObjectReference NewLocalRef () + { + return JniEnvironment.Current.JavaVM.JniHandleManager.CreateLocalReference (JniEnvironment.Current, this); + } + + public JniObjectReference NewWeakGlobalRef () + { + return JniEnvironment.Current.JavaVM.JniHandleManager.CreateWeakGlobalReference (this); + } + + internal void Invalidate () + { +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + if (safeHandle != null) + safeHandle.Invalidate (); + safeHandle = null; +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES + +#if FEATURE_HANDLES_ARE_INTPTRS + Handle = IntPtr.Zero; +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES + + referenceInfo = 0; + } + + public override string ToString () + { + return string.Format ("JniObjectReference(Handle=0x{0}, Type={1})", Handle.ToString ("x"), Type.ToString ()); + } + } +} + diff --git a/src/Java.Interop/Java.Interop/JniReferenceType.cs b/src/Java.Interop/Java.Interop/JniObjectReferenceType.cs similarity index 76% rename from src/Java.Interop/Java.Interop/JniReferenceType.cs rename to src/Java.Interop/Java.Interop/JniObjectReferenceType.cs index 87f9e97ba..2e51f718d 100644 --- a/src/Java.Interop/Java.Interop/JniReferenceType.cs +++ b/src/Java.Interop/Java.Interop/JniObjectReferenceType.cs @@ -2,7 +2,7 @@ namespace Java.Interop { - public enum JniReferenceType { + public enum JniObjectReferenceType { Invalid = 0, Local = 1, Global = 2, diff --git a/src/Java.Interop/Java.Interop/JniPeerFields.cs b/src/Java.Interop/Java.Interop/JniPeerFields.cs index 5b6f75678..906612dc3 100644 --- a/src/Java.Interop/Java.Interop/JniPeerFields.cs +++ b/src/Java.Interop/Java.Interop/JniPeerFields.cs @@ -9,7 +9,7 @@ public bool GetBooleanValue ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetBooleanValue (self.SafeHandle); + .GetBooleanValue (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, bool value) @@ -17,7 +17,7 @@ public void SetValue (string encodedMember, IJavaObject self, bool value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public sbyte GetByteValue ( @@ -27,7 +27,7 @@ public sbyte GetByteValue ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetByteValue (self.SafeHandle); + .GetByteValue (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, sbyte value) @@ -35,7 +35,7 @@ public void SetValue (string encodedMember, IJavaObject self, sbyte value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public char GetCharValue ( @@ -45,7 +45,7 @@ public char GetCharValue ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetCharValue (self.SafeHandle); + .GetCharValue (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, char value) @@ -53,7 +53,7 @@ public void SetValue (string encodedMember, IJavaObject self, char value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public short GetInt16Value ( @@ -63,7 +63,7 @@ public short GetInt16Value ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetInt16Value (self.SafeHandle); + .GetInt16Value (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, short value) @@ -71,7 +71,7 @@ public void SetValue (string encodedMember, IJavaObject self, short value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public int GetInt32Value ( @@ -81,7 +81,7 @@ public int GetInt32Value ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetInt32Value (self.SafeHandle); + .GetInt32Value (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, int value) @@ -89,7 +89,7 @@ public void SetValue (string encodedMember, IJavaObject self, int value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public long GetInt64Value ( @@ -99,7 +99,7 @@ public long GetInt64Value ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetInt64Value (self.SafeHandle); + .GetInt64Value (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, long value) @@ -107,7 +107,7 @@ public void SetValue (string encodedMember, IJavaObject self, long value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public float GetSingleValue ( @@ -117,7 +117,7 @@ public float GetSingleValue ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetSingleValue (self.SafeHandle); + .GetSingleValue (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, float value) @@ -125,7 +125,7 @@ public void SetValue (string encodedMember, IJavaObject self, float value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } public double GetDoubleValue ( @@ -135,7 +135,7 @@ public double GetDoubleValue ( JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetDoubleValue (self.SafeHandle); + .GetDoubleValue (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, double value) @@ -143,25 +143,25 @@ public void SetValue (string encodedMember, IJavaObject self, double value) JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } - public JniLocalReference GetObjectValue ( + public JniObjectReference GetObjectValue ( string encodedMember, IJavaObject self) { JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .GetObjectValue (self.SafeHandle); + .GetObjectValue (self.PeerReference); } - public void SetValue (string encodedMember, IJavaObject self, JniReferenceSafeHandle value) + public void SetValue (string encodedMember, IJavaObject self, JniObjectReference value) { JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } } @@ -170,109 +170,109 @@ partial class JniPeerStaticFields { public bool GetBooleanValue (string encodedMember) { return GetFieldID (encodedMember) - .GetBooleanValue (Members.JniPeerType.SafeHandle); + .GetBooleanValue (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, bool value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public sbyte GetByteValue (string encodedMember) { return GetFieldID (encodedMember) - .GetByteValue (Members.JniPeerType.SafeHandle); + .GetByteValue (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, sbyte value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public char GetCharValue (string encodedMember) { return GetFieldID (encodedMember) - .GetCharValue (Members.JniPeerType.SafeHandle); + .GetCharValue (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, char value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public short GetInt16Value (string encodedMember) { return GetFieldID (encodedMember) - .GetInt16Value (Members.JniPeerType.SafeHandle); + .GetInt16Value (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, short value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public int GetInt32Value (string encodedMember) { return GetFieldID (encodedMember) - .GetInt32Value (Members.JniPeerType.SafeHandle); + .GetInt32Value (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, int value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public long GetInt64Value (string encodedMember) { return GetFieldID (encodedMember) - .GetInt64Value (Members.JniPeerType.SafeHandle); + .GetInt64Value (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, long value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public float GetSingleValue (string encodedMember) { return GetFieldID (encodedMember) - .GetSingleValue (Members.JniPeerType.SafeHandle); + .GetSingleValue (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, float value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } public double GetDoubleValue (string encodedMember) { return GetFieldID (encodedMember) - .GetDoubleValue (Members.JniPeerType.SafeHandle); + .GetDoubleValue (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, double value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } - public JniLocalReference GetObjectValue (string encodedMember) + public JniObjectReference GetObjectValue (string encodedMember) { return GetFieldID (encodedMember) - .GetObjectValue (Members.JniPeerType.SafeHandle); + .GetObjectValue (Members.JniPeerType.PeerReference); } - public void SetValue (string encodedMember, JniReferenceSafeHandle value) + public void SetValue (string encodedMember, JniObjectReference value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } } } diff --git a/src/Java.Interop/Java.Interop/JniPeerFields.tt b/src/Java.Interop/Java.Interop/JniPeerFields.tt index 10a4a6352..e735d14d5 100644 --- a/src/Java.Interop/Java.Interop/JniPeerFields.tt +++ b/src/Java.Interop/Java.Interop/JniPeerFields.tt @@ -13,7 +13,7 @@ new { JniCallType = "Int64", ReturnType = "long", ParameterType = "long" }, new { JniCallType = "Single", ReturnType = "float", ParameterType = "float" }, new { JniCallType = "Double", ReturnType = "double", ParameterType = "double" }, - new { JniCallType = "Object", ReturnType = "JniLocalReference", ParameterType = "JniReferenceSafeHandle" }, + new { JniCallType = "Object", ReturnType = "JniObjectReference", ParameterType = "JniObjectReference" }, }; #> @@ -31,7 +31,7 @@ namespace Java.Interop { JniPeerMembers.AssertSelf (self); return GetFieldID (encodedMember) - .Get<#= info.JniCallType #>Value (self.SafeHandle); + .Get<#= info.JniCallType #>Value (self.PeerReference); } public void SetValue (string encodedMember, IJavaObject self, <#= info.ParameterType #> value) @@ -39,7 +39,7 @@ namespace Java.Interop { JniPeerMembers.AssertSelf (self); GetFieldID (encodedMember) - .SetValue (self.SafeHandle, value); + .SetValue (self.PeerReference, value); } <# } @@ -54,13 +54,13 @@ namespace Java.Interop { public <#= info.ReturnType #> Get<#= info.JniCallType #>Value (string encodedMember) { return GetFieldID (encodedMember) - .Get<#= info.JniCallType #>Value (Members.JniPeerType.SafeHandle); + .Get<#= info.JniCallType #>Value (Members.JniPeerType.PeerReference); } public void SetValue (string encodedMember, <#= info.ParameterType #> value) { GetFieldID (encodedMember) - .SetValue (Members.JniPeerType.SafeHandle, value); + .SetValue (Members.JniPeerType.PeerReference, value); } <# } diff --git a/src/Java.Interop/Java.Interop/JniPeerInstanceFields.cs b/src/Java.Interop/Java.Interop/JniPeerInstanceFields.cs index 5d96fbfb3..17606bbf7 100644 --- a/src/Java.Interop/Java.Interop/JniPeerInstanceFields.cs +++ b/src/Java.Interop/Java.Interop/JniPeerInstanceFields.cs @@ -19,8 +19,6 @@ internal void Dispose () if (InstanceFields == null) return; - foreach (var f in InstanceFields.Values) - f.Dispose (); InstanceFields = null; } diff --git a/src/Java.Interop/Java.Interop/JniPeerInstanceMethods.cs b/src/Java.Interop/Java.Interop/JniPeerInstanceMethods.cs index cd6f815c2..f7490c050 100644 --- a/src/Java.Interop/Java.Interop/JniPeerInstanceMethods.cs +++ b/src/Java.Interop/Java.Interop/JniPeerInstanceMethods.cs @@ -38,8 +38,6 @@ internal void Dispose () return; // Don't dispose JniPeerType; it's shared with others. - foreach (var m in InstanceMethods.Values) - m.Dispose (); InstanceMethods = null; foreach (var p in SubclassConstructors.Values) @@ -92,25 +90,28 @@ public JniInstanceMethodID GetMethodID (string encodedMember) } } - public unsafe JniLocalReference StartCreateInstance (string constructorSignature, Type declaringType, JValue* parameters) + public unsafe JniObjectReference StartCreateInstance (string constructorSignature, Type declaringType, JValue* parameters) { if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (constructorSignature, declaringType, parameters); } - using (var lref = GetConstructorsForType (declaringType) - .JniPeerType - .AllocObject ()) - return lref.ToAllocObjectRef (); + var r = GetConstructorsForType (declaringType) + .JniPeerType + .AllocObject (); + r.Flags = JniObjectReferenceFlags.Alloc; + return r; } - internal JniLocalReference AllocObject (Type declaringType) + internal JniObjectReference AllocObject (Type declaringType) { - return GetConstructorsForType (declaringType) + var r = GetConstructorsForType (declaringType) .JniPeerType .AllocObject (); + r.Flags = JniObjectReferenceFlags.Alloc; + return r; } - internal unsafe JniLocalReference NewObject (string constructorSignature, Type declaringType, JValue* parameters) + internal unsafe JniObjectReference NewObject (string constructorSignature, Type declaringType, JValue* parameters) { var methods = GetConstructorsForType (declaringType); var ctor = methods.GetConstructor (constructorSignature); @@ -124,7 +125,7 @@ public unsafe void FinishCreateInstance (string constructorSignature, IJavaObjec } var methods = GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, parameters); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, parameters); } public unsafe void CallVoidMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -133,12 +134,12 @@ public unsafe void CallVoidMethod (string encodedMember, IJavaObject self, JValu if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - m.CallVirtualVoidMethod (self.SafeHandle, parameters); + m.CallVirtualVoidMethod (self.PeerReference, parameters); return; } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - n.CallNonvirtualVoidMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + n.CallNonvirtualVoidMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe bool CallBooleanMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -147,11 +148,11 @@ public unsafe bool CallBooleanMethod (string encodedMember, IJavaObject self, JV if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualBooleanMethod (self.SafeHandle, parameters); + return m.CallVirtualBooleanMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualBooleanMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualBooleanMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe sbyte CallSByteMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -160,11 +161,11 @@ public unsafe sbyte CallSByteMethod (string encodedMember, IJavaObject self, JVa if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualSByteMethod (self.SafeHandle, parameters); + return m.CallVirtualSByteMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualSByteMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualSByteMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe char CallCharMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -173,11 +174,11 @@ public unsafe char CallCharMethod (string encodedMember, IJavaObject self, JValu if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualCharMethod (self.SafeHandle, parameters); + return m.CallVirtualCharMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualCharMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualCharMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe short CallInt16Method (string encodedMember, IJavaObject self, JValue* parameters) @@ -186,11 +187,11 @@ public unsafe short CallInt16Method (string encodedMember, IJavaObject self, JVa if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualInt16Method (self.SafeHandle, parameters); + return m.CallVirtualInt16Method (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualInt16Method (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualInt16Method (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe int CallInt32Method (string encodedMember, IJavaObject self, JValue* parameters) @@ -199,11 +200,11 @@ public unsafe int CallInt32Method (string encodedMember, IJavaObject self, JValu if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualInt32Method (self.SafeHandle, parameters); + return m.CallVirtualInt32Method (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualInt32Method (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualInt32Method (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe long CallInt64Method (string encodedMember, IJavaObject self, JValue* parameters) @@ -212,11 +213,11 @@ public unsafe long CallInt64Method (string encodedMember, IJavaObject self, JVal if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualInt64Method (self.SafeHandle, parameters); + return m.CallVirtualInt64Method (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualInt64Method (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualInt64Method (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe float CallSingleMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -225,11 +226,11 @@ public unsafe float CallSingleMethod (string encodedMember, IJavaObject self, JV if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualSingleMethod (self.SafeHandle, parameters); + return m.CallVirtualSingleMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualSingleMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualSingleMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } public unsafe double CallDoubleMethod (string encodedMember, IJavaObject self, JValue* parameters) @@ -238,30 +239,30 @@ public unsafe double CallDoubleMethod (string encodedMember, IJavaObject self, J if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualDoubleMethod (self.SafeHandle, parameters); + return m.CallVirtualDoubleMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualDoubleMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualDoubleMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } - public unsafe JniLocalReference CallObjectMethod (string encodedMember, IJavaObject self, JValue* parameters) + public unsafe JniObjectReference CallObjectMethod (string encodedMember, IJavaObject self, JValue* parameters) { JniPeerMembers.AssertSelf (self); if (self.GetType () == DeclaringType || DeclaringType == null) { var m = GetMethodID (encodedMember); - return m.CallVirtualObjectMethod (self.SafeHandle, parameters); + return m.CallVirtualObjectMethod (self.PeerReference, parameters); } var j = self.JniPeerMembers; var n = j.InstanceMethods.GetMethodID (encodedMember); - return n.CallNonvirtualObjectMethod (self.SafeHandle, j.JniPeerType.SafeHandle, parameters); + return n.CallNonvirtualObjectMethod (self.PeerReference, j.JniPeerType.PeerReference, parameters); } } struct JniArgumentMarshalInfo { JValue jvalue; - JniLocalReference lref; + JniObjectReference lref; IJavaObject obj; Action cleanup; @@ -291,8 +292,7 @@ public void Cleanup (object value) { if (cleanup != null && obj != null) cleanup (obj, value); - if (lref != null) - lref.Dispose (); + JniEnvironment.Handles.Dispose (ref lref, JniHandleOwnership.Transfer); } } } diff --git a/src/Java.Interop/Java.Interop/JniPeerMembers.cs b/src/Java.Interop/Java.Interop/JniPeerMembers.cs index 8b1ab4237..e15ce20e4 100644 --- a/src/Java.Interop/Java.Interop/JniPeerMembers.cs +++ b/src/Java.Interop/Java.Interop/JniPeerMembers.cs @@ -123,9 +123,13 @@ internal static void AssertSelf (IJavaObject self) { if (self == null) throw new ArgumentNullException ("self"); - if (self.SafeHandle == null || self.SafeHandle.IsInvalid) + + var peer = self.PeerReference; + if (!peer.IsValid) throw new ObjectDisposedException (self.GetType ().FullName); - var lref = self.SafeHandle as JniLocalReference; + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + var lref = peer.SafeHandle as JniLocalReference; if (lref != null && !JniEnvironment.IsHandleValid (lref)) { var t = self.GetType ().FullName; throw new NotSupportedException ( @@ -134,6 +138,7 @@ internal static void AssertSelf (IJavaObject self) "Passing JNI local references between threads is not supported; " + "call IJavaObject.RegisterWithVM() if sharing between threads is required."); } +#endif } internal static int GetSignatureSeparatorIndex (string encodedMember) diff --git a/src/Java.Interop/Java.Interop/JniPeerMethods.cs b/src/Java.Interop/Java.Interop/JniPeerMethods.cs index 01fb34e4b..31f7dc1d0 100644 --- a/src/Java.Interop/Java.Interop/JniPeerMethods.cs +++ b/src/Java.Interop/Java.Interop/JniPeerMethods.cs @@ -4,7 +4,7 @@ namespace Java.Interop.GenericMarshaler { public static partial class JniPeerInstanceMethodsExtensions { - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -14,11 +14,10 @@ T value if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, value); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -65,13 +64,13 @@ T value try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg.Cleanup (value); } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -81,11 +80,10 @@ public static JniLocalReference StartGenericCreateInstance ( if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, value1, value2); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -137,14 +135,14 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -154,11 +152,10 @@ public static JniLocalReference StartGenericCreateInstance ( if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, value1, value2, value3); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -215,7 +212,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -223,7 +220,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -233,11 +230,10 @@ public static JniLocalReference StartGenericCreateInstance ( if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, value1, value2, value3, value4); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -299,7 +295,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -308,7 +304,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -318,11 +314,10 @@ public static JniLocalReference StartGenericCreateInstance ( if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, value1, value2, value3, value4, value5); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -389,7 +384,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -399,7 +394,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -409,11 +404,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -485,7 +479,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -496,7 +490,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -506,11 +500,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -587,7 +580,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -599,7 +592,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -609,11 +602,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -695,7 +687,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -708,7 +700,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -718,11 +710,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -809,7 +800,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -823,7 +814,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -833,11 +824,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -929,7 +919,7 @@ static unsafe void _InvokeConstructor ( try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { arg1.Cleanup (value1); arg2.Cleanup (value2); @@ -944,7 +934,7 @@ static unsafe void _InvokeConstructor ( } } - public static JniLocalReference StartGenericCreateInstance ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -954,11 +944,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1055,7 +1044,7 @@ static unsafe void _InvokeConstructor ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1081,11 +1070,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1187,7 +1175,7 @@ static unsafe void _InvokeConstructor ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1214,11 +1202,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1325,7 +1312,7 @@ static unsafe void _InvokeConstructor ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1353,11 +1340,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1469,7 +1455,7 @@ static unsafe void _InvokeConstructor ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1498,11 +1484,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1619,7 +1604,7 @@ static unsafe void _InvokeConstructor ( + public static JniObjectReference StartGenericCreateInstance ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1649,11 +1634,10 @@ public static JniLocalReference StartGenericCreateInstance ( + static unsafe JniObjectReference NewObject ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -1775,7 +1759,7 @@ static unsafe void _InvokeConstructor ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -7941,7 +7925,7 @@ T value } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -7963,7 +7947,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -7988,7 +7972,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8016,7 +8000,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8047,7 +8031,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8081,7 +8065,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8118,7 +8102,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8158,7 +8142,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8201,7 +8185,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8247,7 +8231,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8296,7 +8280,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8348,7 +8332,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8403,7 +8387,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8461,7 +8445,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -8522,7 +8506,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerInstanceMethods peer, string encodedMember, IJavaObject self, @@ -14422,7 +14406,7 @@ public static unsafe double CallGenericDoubleMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T value @@ -14440,7 +14424,7 @@ T value } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2 @@ -14461,7 +14445,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3 @@ -14485,7 +14469,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4 @@ -14512,7 +14496,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( } } - public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5 @@ -14542,7 +14526,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6 @@ -14575,7 +14559,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7 @@ -14611,7 +14595,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8 @@ -14650,7 +14634,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9 @@ -14692,7 +14676,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10 @@ -14737,7 +14721,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11 @@ -14785,7 +14769,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, T12 value12 @@ -14836,7 +14820,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13 @@ -14890,7 +14874,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 value14 @@ -14947,7 +14931,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 value15 @@ -15007,7 +14991,7 @@ public static unsafe JniLocalReference CallGenericObjectMethod ( + public static unsafe JniObjectReference CallGenericObjectMethod ( this JniPeerStaticMethods peer, string encodedMember, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10, T11 value11, T12 value12, T13 value13, T14 value14, T15 value15, T16 value16 diff --git a/src/Java.Interop/Java.Interop/JniPeerMethods.tt b/src/Java.Interop/Java.Interop/JniPeerMethods.tt index 3b371e390..237350ce8 100644 --- a/src/Java.Interop/Java.Interop/JniPeerMethods.tt +++ b/src/Java.Interop/Java.Interop/JniPeerMethods.tt @@ -14,7 +14,7 @@ new { JniCallType = "Int64", ReturnType = "long" }, new { JniCallType = "Single", ReturnType = "float" }, new { JniCallType = "Double", ReturnType = "double" }, - new { JniCallType = "Object", ReturnType = "JniLocalReference" }, + new { JniCallType = "Object", ReturnType = "JniObjectReference" }, }; #> @@ -45,7 +45,7 @@ namespace Java.Interop.GenericMarshaler { } #> - public static JniLocalReference StartGenericCreateInstance<#= typeParams #> ( + public static JniObjectReference StartGenericCreateInstance<#= typeParams #> ( this JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -55,11 +55,10 @@ namespace Java.Interop.GenericMarshaler { if (JniEnvironment.Current.JavaVM.NewObjectRequired) { return NewObject (peer, constructorSignature, declaringType, <#= methodArgs #>); } - using (var lref = peer.AllocObject (declaringType)) - return lref.ToAllocObjectRef (); + return peer.AllocObject (declaringType); } - static unsafe JniLocalReference NewObject<#= typeParams #> ( + static unsafe JniObjectReference NewObject<#= typeParams #> ( JniPeerInstanceMethods peer, string constructorSignature, Type declaringType, @@ -131,7 +130,7 @@ namespace Java.Interop.GenericMarshaler { try { var methods = peer.GetConstructorsForType (self.GetType ()); var ctor = methods.GetConstructor (constructorSignature); - ctor.CallNonvirtualVoidMethod (self.SafeHandle, methods.JniPeerType.SafeHandle, args); + ctor.CallNonvirtualVoidMethod (self.PeerReference, methods.JniPeerType.PeerReference, args); } finally { <# for (int a = 1; a <= i; ++a) { diff --git a/src/Java.Interop/Java.Interop/JniPeerStaticFields.cs b/src/Java.Interop/Java.Interop/JniPeerStaticFields.cs index 1f702b3ad..0768a133f 100644 --- a/src/Java.Interop/Java.Interop/JniPeerStaticFields.cs +++ b/src/Java.Interop/Java.Interop/JniPeerStaticFields.cs @@ -33,8 +33,6 @@ internal void Dispose () if (StaticFields == null) return; - foreach (var f in StaticFields.Values) - f.Dispose (); StaticFields = null; } } diff --git a/src/Java.Interop/Java.Interop/JniPeerStaticMethods.cs b/src/Java.Interop/Java.Interop/JniPeerStaticMethods.cs index 55c113a4f..155531a76 100644 --- a/src/Java.Interop/Java.Interop/JniPeerStaticMethods.cs +++ b/src/Java.Interop/Java.Interop/JniPeerStaticMethods.cs @@ -19,8 +19,6 @@ internal void Dispose () if (StaticMethods == null) return; - foreach (var m in StaticMethods.Values) - m.Dispose (); StaticMethods = null; } @@ -41,61 +39,61 @@ public JniStaticMethodID GetMethodID (string encodedMember) public unsafe void CallVoidMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - m.CallVoidMethod (Members.JniPeerType.SafeHandle, parameters); + m.CallVoidMethod (Members.JniPeerType.PeerReference, parameters); } public unsafe bool CallBooleanMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallBooleanMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallBooleanMethod (Members.JniPeerType.PeerReference, parameters); } public unsafe sbyte CallSByteMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallSByteMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallSByteMethod (Members.JniPeerType.PeerReference, parameters); } public unsafe char CallCharMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallCharMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallCharMethod (Members.JniPeerType.PeerReference, parameters); } public unsafe short CallInt16Method (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallInt16Method (Members.JniPeerType.SafeHandle, parameters); + return m.CallInt16Method (Members.JniPeerType.PeerReference, parameters); } public unsafe int CallInt32Method (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallInt32Method (Members.JniPeerType.SafeHandle, parameters); + return m.CallInt32Method (Members.JniPeerType.PeerReference, parameters); } public unsafe long CallInt64Method (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallInt64Method (Members.JniPeerType.SafeHandle, parameters); + return m.CallInt64Method (Members.JniPeerType.PeerReference, parameters); } public unsafe float CallSingleMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallSingleMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallSingleMethod (Members.JniPeerType.PeerReference, parameters); } public unsafe double CallDoubleMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallDoubleMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallDoubleMethod (Members.JniPeerType.PeerReference, parameters); } - public unsafe JniLocalReference CallObjectMethod (string encodedMember, JValue* parameters) + public unsafe JniObjectReference CallObjectMethod (string encodedMember, JValue* parameters) { var m = GetMethodID (encodedMember); - return m.CallObjectMethod (Members.JniPeerType.SafeHandle, parameters); + return m.CallObjectMethod (Members.JniPeerType.PeerReference, parameters); } } } diff --git a/src/Java.Interop/Java.Interop/JniReferenceSafeHandle.cs b/src/Java.Interop/Java.Interop/JniReferenceSafeHandle.cs index 242d4d22c..e6c53f2a6 100644 --- a/src/Java.Interop/Java.Interop/JniReferenceSafeHandle.cs +++ b/src/Java.Interop/Java.Interop/JniReferenceSafeHandle.cs @@ -2,9 +2,10 @@ using System.Diagnostics; using System.Runtime.InteropServices; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES namespace Java.Interop { - public abstract class JniReferenceSafeHandle : SafeHandle + abstract class JniReferenceSafeHandle : SafeHandle { public static readonly JniReferenceSafeHandle Null = new JniInvocationHandle (IntPtr.Zero); @@ -22,11 +23,11 @@ public override bool IsInvalid { get {return base.handle == IntPtr.Zero;} } - public JniReferenceType ReferenceType { + public JniObjectReferenceType ReferenceType { get { if (IsInvalid) throw new ObjectDisposedException (GetType ().FullName); - return JniEnvironment.Handles.GetObjectRefType (this); + return JniEnvironment.Handles.GetObjectRefType (new JniObjectReference (this)); } } @@ -37,24 +38,33 @@ internal IntPtr _GetAndClearHandle () return h; } + internal void Invalidate () + { + handle = IntPtr.Zero; + } + public JniGlobalReference NewGlobalRef () { - return JniEnvironment.Current.JavaVM.JniHandleManager.CreateGlobalReference (this); + var r = new JniObjectReference (DangerousGetHandle (), ReferenceType); + return new JniGlobalReference (r.NewGlobalRef ().Handle); } public JniLocalReference NewLocalRef () { - return JniEnvironment.Current.JavaVM.JniHandleManager.CreateLocalReference (JniEnvironment.Current, this); + var r = new JniObjectReference (DangerousGetHandle (), ReferenceType); + return new JniLocalReference (r.NewLocalRef ().Handle); } public JniWeakGlobalReference NewWeakGlobalRef () { - return JniEnvironment.Current.JavaVM.JniHandleManager.CreateWeakGlobalReference (this); + var r = new JniObjectReference (DangerousGetHandle (), ReferenceType); + return new JniWeakGlobalReference (r.NewWeakGlobalRef ().Handle); } internal string GetJniTypeName () { - return JniEnvironment.Types.GetJniTypeNameFromInstance (this); + var r = new JniObjectReference (DangerousGetHandle (), ReferenceType); + return JniEnvironment.Types.GetJniTypeNameFromInstance (r); } public override string ToString () @@ -63,7 +73,7 @@ public override string ToString () } } - public class JniInvocationHandle : JniReferenceSafeHandle { + class JniInvocationHandle : JniReferenceSafeHandle { public JniInvocationHandle (IntPtr handle) : base (ownsHandle:false) @@ -77,4 +87,5 @@ protected override bool ReleaseHandle () } } } +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES diff --git a/src/Java.Interop/Java.Interop/JniStaticFieldID.cs b/src/Java.Interop/Java.Interop/JniStaticFieldID.cs index 9fcfb7f8b..48f19c0fa 100644 --- a/src/Java.Interop/Java.Interop/JniStaticFieldID.cs +++ b/src/Java.Interop/Java.Interop/JniStaticFieldID.cs @@ -5,96 +5,97 @@ namespace Java.Interop { public sealed class JniStaticFieldID : JniFieldID { - JniStaticFieldID () + internal JniStaticFieldID (IntPtr fieldID) + : base (fieldID) { } - public JniLocalReference GetObjectValue (JniReferenceSafeHandle @class) + public JniObjectReference GetObjectValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticObjectField (@class, this); } - public bool GetBooleanValue (JniReferenceSafeHandle @class) + public bool GetBooleanValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticBooleanField (@class, this); } - public sbyte GetByteValue (JniReferenceSafeHandle @class) + public sbyte GetByteValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticByteField (@class, this); } - public char GetCharValue (JniReferenceSafeHandle @class) + public char GetCharValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticCharField (@class, this); } - public short GetInt16Value (JniReferenceSafeHandle @class) + public short GetInt16Value (JniObjectReference @class) { return JniEnvironment.Members.GetStaticShortField (@class, this); } - public int GetInt32Value (JniReferenceSafeHandle @class) + public int GetInt32Value (JniObjectReference @class) { return JniEnvironment.Members.GetStaticIntField (@class, this); } - public long GetInt64Value (JniReferenceSafeHandle @class) + public long GetInt64Value (JniObjectReference @class) { return JniEnvironment.Members.GetStaticLongField (@class, this); } - public float GetSingleValue (JniReferenceSafeHandle @class) + public float GetSingleValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticFloatField (@class, this); } - public double GetDoubleValue (JniReferenceSafeHandle @class) + public double GetDoubleValue (JniObjectReference @class) { return JniEnvironment.Members.GetStaticDoubleField (@class, this); } - public void SetValue (JniReferenceSafeHandle @class, JniReferenceSafeHandle value) + public void SetValue (JniObjectReference @class, JniObjectReference value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, bool value) + public void SetValue (JniObjectReference @class, bool value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, sbyte value) + public void SetValue (JniObjectReference @class, sbyte value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, char value) + public void SetValue (JniObjectReference @class, char value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, short value) + public void SetValue (JniObjectReference @class, short value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, int value) + public void SetValue (JniObjectReference @class, int value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, long value) + public void SetValue (JniObjectReference @class, long value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, float value) + public void SetValue (JniObjectReference @class, float value) { JniEnvironment.Members.SetStaticField (@class, this, value); } - public void SetValue (JniReferenceSafeHandle @class, double value) + public void SetValue (JniObjectReference @class, double value) { JniEnvironment.Members.SetStaticField (@class, this, value); } diff --git a/src/Java.Interop/Java.Interop/JniStaticMethodID.cs b/src/Java.Interop/Java.Interop/JniStaticMethodID.cs index 48c38e24f..d93c7ad00 100644 --- a/src/Java.Interop/Java.Interop/JniStaticMethodID.cs +++ b/src/Java.Interop/Java.Interop/JniStaticMethodID.cs @@ -6,106 +6,107 @@ namespace Java.Interop public sealed class JniStaticMethodID : JniMethodID { - JniStaticMethodID () + internal JniStaticMethodID (IntPtr methodID) + : base (methodID) { } - public void CallVoidMethod (JniReferenceSafeHandle type) + public void CallVoidMethod (JniObjectReference type) { JniEnvironment.Members.CallStaticVoidMethod (type, this); } - public unsafe void CallVoidMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe void CallVoidMethod (JniObjectReference type, JValue* parameters) { JniEnvironment.Members.CallStaticVoidMethod (type, this, parameters); } - public JniLocalReference CallObjectMethod (JniReferenceSafeHandle type) + public JniObjectReference CallObjectMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticObjectMethod (type, this); } - public unsafe JniLocalReference CallObjectMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe JniObjectReference CallObjectMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticObjectMethod (type, this, parameters); } - public bool CallBooleanMethod (JniReferenceSafeHandle type) + public bool CallBooleanMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticBooleanMethod (type, this); } - public unsafe bool CallBooleanMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe bool CallBooleanMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticBooleanMethod (type, this, parameters); } - public sbyte CallSByteMethod (JniReferenceSafeHandle type) + public sbyte CallSByteMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticSByteMethod (type, this); } - public unsafe sbyte CallSByteMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe sbyte CallSByteMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticSByteMethod (type, this, parameters); } - public char CallCharMethod (JniReferenceSafeHandle type) + public char CallCharMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticCharMethod (type, this); } - public unsafe char CallCharMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe char CallCharMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticCharMethod (type, this, parameters); } - public short CallInt16Method (JniReferenceSafeHandle type) + public short CallInt16Method (JniObjectReference type) { return JniEnvironment.Members.CallStaticShortMethod (type, this); } - public unsafe short CallInt16Method (JniReferenceSafeHandle type, JValue* parameters) + public unsafe short CallInt16Method (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticShortMethod (type, this, parameters); } - public int CallInt32Method (JniReferenceSafeHandle type) + public int CallInt32Method (JniObjectReference type) { return JniEnvironment.Members.CallStaticIntMethod (type, this); } - public unsafe int CallInt32Method (JniReferenceSafeHandle type, JValue* parameters) + public unsafe int CallInt32Method (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticIntMethod (type, this, parameters); } - public long CallInt64Method (JniReferenceSafeHandle type) + public long CallInt64Method (JniObjectReference type) { return JniEnvironment.Members.CallStaticLongMethod (type, this); } - public unsafe long CallInt64Method (JniReferenceSafeHandle type, JValue* parameters) + public unsafe long CallInt64Method (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticLongMethod (type, this, parameters); } - public float CallSingleMethod (JniReferenceSafeHandle type) + public float CallSingleMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticFloatMethod (type, this); } - public unsafe float CallSingleMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe float CallSingleMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticFloatMethod (type, this, parameters); } - public double CallDoubleMethod (JniReferenceSafeHandle type) + public double CallDoubleMethod (JniObjectReference type) { return JniEnvironment.Members.CallStaticDoubleMethod (type, this); } - public unsafe double CallDoubleMethod (JniReferenceSafeHandle type, JValue* parameters) + public unsafe double CallDoubleMethod (JniObjectReference type, JValue* parameters) { return JniEnvironment.Members.CallStaticDoubleMethod (type, this, parameters); } diff --git a/src/Java.Interop/Java.Interop/JniSystem.cs b/src/Java.Interop/Java.Interop/JniSystem.cs index 7c3420539..04b723446 100644 --- a/src/Java.Interop/Java.Interop/JniSystem.cs +++ b/src/Java.Interop/Java.Interop/JniSystem.cs @@ -9,12 +9,12 @@ static JniType TypeRef { } static JniStaticMethodID _identityHashCode; - internal static unsafe int IdentityHashCode (JniReferenceSafeHandle value) + internal static unsafe int IdentityHashCode (JniObjectReference value) { var args = stackalloc JValue [1]; args [0] = new JValue (value); return TypeRef.GetCachedStaticMethod (ref _identityHashCode, "identityHashCode", "(Ljava/lang/Object;)I") - .CallInt32Method (TypeRef.SafeHandle, args); + .CallInt32Method (TypeRef.PeerReference, args); } } } diff --git a/src/Java.Interop/Java.Interop/JniType.cs b/src/Java.Interop/Java.Interop/JniType.cs index b845bb87b..f7ec8076a 100644 --- a/src/Java.Interop/Java.Interop/JniType.cs +++ b/src/Java.Interop/Java.Interop/JniType.cs @@ -11,33 +11,40 @@ namespace Java.Interop { public sealed class JniType : IDisposable { - public static unsafe JniType DefineClass (string name, JniReferenceSafeHandle loader, byte[] classFileData) + public static unsafe JniType DefineClass (string name, JniObjectReference loader, byte[] classFileData) { fixed (byte* buf = classFileData) { var lref = JniEnvironment.Types.DefineClass (name, loader, (IntPtr) buf, classFileData.Length); - return new JniType (lref, JniHandleOwnership.Transfer); + return new JniType (ref lref, JniHandleOwnership.Transfer); } } bool registered; + JniObjectReference peer; - public JniReferenceSafeHandle SafeHandle {get; private set;} + public JniObjectReference PeerReference { + get {return peer;} + } public JniType (string classname) - : this (JniEnvironment.Types.FindClass (classname), JniHandleOwnership.Transfer) { + var peer = JniEnvironment.Types.FindClass (classname); + Initialize (ref peer, JniHandleOwnership.Transfer); + } + + public JniType (ref JniObjectReference handle, JniHandleOwnership transfer) + { + Initialize (ref handle, transfer); } - public JniType (JniReferenceSafeHandle safeHandle, JniHandleOwnership transfer) + void Initialize (ref JniObjectReference handle, JniHandleOwnership transfer) { - if (safeHandle == null) - throw new ArgumentNullException ("safeHandle"); - if (safeHandle.IsInvalid) - throw new ArgumentException ("safeHandle must be valid.", "safeHandle"); + if (handle.Handle == IntPtr.Zero) + throw new ArgumentException ("handle must be valid.", nameof (handle)); try { - SafeHandle = safeHandle.NewLocalRef (); + peer = handle.NewLocalRef (); } finally { - JniEnvironment.Handles.Dispose (safeHandle, transfer); + JniEnvironment.Handles.Dispose (ref handle, transfer); } } @@ -45,7 +52,7 @@ public string Name { get { AssertValid (); - return JniEnvironment.Types.GetJniTypeNameFromClass (SafeHandle); + return JniEnvironment.Types.GetJniTypeNameFromClass (PeerReference); } } @@ -57,10 +64,10 @@ public void RegisterWithVM () return; lock (this) { - if (SafeHandle.ReferenceType != JniReferenceType.Global) { - var o = SafeHandle; - SafeHandle = o.NewGlobalRef (); - o.Dispose (); + if (peer.Type != JniObjectReferenceType.Global) { + var o = peer; + peer = o.NewGlobalRef (); + JniEnvironment.Handles.Dispose (ref o, JniHandleOwnership.Transfer); } JniEnvironment.Current.JavaVM.Track (this); registered = true; @@ -69,13 +76,13 @@ public void RegisterWithVM () void AssertValid () { - if (SafeHandle == null || SafeHandle.IsInvalid) + if (PeerReference.Handle == IntPtr.Zero) throw new ObjectDisposedException (GetType ().FullName); } public static JniType GetCachedJniType (ref JniType cachedType, string classname) { - if (cachedType != null && !cachedType.SafeHandle.IsInvalid) + if (cachedType != null && cachedType.PeerReference.Handle != IntPtr.Zero) return cachedType; var t = new JniType (classname); if (Interlocked.CompareExchange (ref cachedType, t, null) != null) @@ -86,23 +93,22 @@ public static JniType GetCachedJniType (ref JniType cachedType, string classname public void Dispose () { - if (SafeHandle == null || SafeHandle.IsInvalid) + if (!PeerReference.IsValid) return; if (registered) - JniEnvironment.Current.JavaVM.UnTrack (SafeHandle); + JniEnvironment.Current.JavaVM.UnTrack (PeerReference.Handle); if (methods != null) UnregisterNativeMethods (); - SafeHandle.Dispose (); - SafeHandle = null; + JniEnvironment.Handles.Dispose (ref peer); } public JniType GetSuperclass () { AssertValid (); - var lref = JniEnvironment.Types.GetSuperclass (SafeHandle); - if (!lref.IsInvalid) - return new JniType (lref, JniHandleOwnership.Transfer); + var lref = JniEnvironment.Types.GetSuperclass (PeerReference); + if (lref.IsValid) + return new JniType (ref lref, JniHandleOwnership.Transfer); return null; } @@ -112,17 +118,17 @@ public bool IsAssignableFrom (JniType c) if (c == null) throw new ArgumentNullException ("c"); - if (c.SafeHandle == null || c.SafeHandle.IsInvalid) + if (!c.PeerReference.IsValid) throw new ArgumentException ("'c' has an invalid handle.", "c"); - return JniEnvironment.Types.IsAssignableFrom (c.SafeHandle, SafeHandle); + return JniEnvironment.Types.IsAssignableFrom (c.PeerReference, PeerReference); } - public bool IsInstanceOfType (JniReferenceSafeHandle value) + public bool IsInstanceOfType (JniObjectReference value) { AssertValid (); - return JniEnvironment.Types.IsInstanceOf (value, SafeHandle); + return JniEnvironment.Types.IsInstanceOf (value, PeerReference); } #pragma warning disable 0414 @@ -141,7 +147,7 @@ public void RegisterNativeMethods (params JniNativeMethodRegistration[] methods) methods [i].Marshaler = JniMarshalMethod.Wrap (methods [i].Marshaler); } - int r = JniEnvironment.Types.RegisterNatives (SafeHandle, methods, checked ((int)methods.Length)); + int r = JniEnvironment.Types.RegisterNatives (PeerReference, methods, checked ((int)methods.Length)); if (r != 0) throw new JavaException ("Unable to register native methods."); // Prevents method delegates from being GC'd so long as this type remains @@ -153,14 +159,14 @@ public void UnregisterNativeMethods () { AssertValid (); - JniEnvironment.Types.UnregisterNatives (SafeHandle); + JniEnvironment.Types.UnregisterNatives (PeerReference); } public JniInstanceMethodID GetConstructor (string signature) { AssertValid (); - return JniEnvironment.Members.GetMethodID (SafeHandle, "", signature); + return JniEnvironment.Members.GetMethodID (PeerReference, "", signature); } public JniInstanceMethodID GetCachedConstructor (ref JniInstanceMethodID cachedMethod, string signature) @@ -170,36 +176,37 @@ public JniInstanceMethodID GetCachedConstructor (ref JniInstanceMethodID cachedM return GetCachedInstanceMethod (ref cachedMethod, "", signature); } - public JniLocalReference AllocObject () + public JniObjectReference AllocObject () { AssertValid (); - return JniEnvironment.Activator.AllocObject (SafeHandle); + return JniEnvironment.Activator.AllocObject (PeerReference); } - public unsafe JniLocalReference NewObject (JniInstanceMethodID constructor, JValue* @parameters) + public unsafe JniObjectReference NewObject (JniInstanceMethodID constructor, JValue* @parameters) { AssertValid (); - return JniEnvironment.Activator.NewObject (SafeHandle, constructor, parameters); + return JniEnvironment.Activator.NewObject (PeerReference, constructor, parameters); } public JniInstanceFieldID GetInstanceField (string name, string signature) { AssertValid (); - return JniEnvironment.Members.GetFieldID (SafeHandle, name, signature); + return JniEnvironment.Members.GetFieldID (PeerReference, name, signature); } public JniInstanceFieldID GetCachedInstanceField (ref JniInstanceFieldID cachedField, string name, string signature) { AssertValid (); - if (cachedField != null && !cachedField.IsInvalid) + if (cachedField != null && cachedField.IsValid) return cachedField; var m = GetInstanceField (name, signature); - if (Interlocked.CompareExchange (ref cachedField, m, null) != null) - m.Dispose (); + if (Interlocked.CompareExchange (ref cachedField, m, null) != null) { + // No cleanup required; let the GC collect the unused instance + } return cachedField; } @@ -207,18 +214,19 @@ public JniStaticFieldID GetStaticField (string name, string signature) { AssertValid (); - return JniEnvironment.Members.GetStaticFieldID (SafeHandle, name, signature); + return JniEnvironment.Members.GetStaticFieldID (PeerReference, name, signature); } public JniStaticFieldID GetCachedStaticField (ref JniStaticFieldID cachedField, string name, string signature) { AssertValid (); - if (cachedField != null && !cachedField.IsInvalid) + if (cachedField != null && cachedField.IsValid) return cachedField; var m = GetStaticField (name, signature); - if (Interlocked.CompareExchange (ref cachedField, m, null) != null) - m.Dispose (); + if (Interlocked.CompareExchange (ref cachedField, m, null) != null) { + // No cleanup required; let the GC collect the unused instance + } return cachedField; } @@ -226,18 +234,19 @@ public JniInstanceMethodID GetInstanceMethod (string name, string signature) { AssertValid (); - return JniEnvironment.Members.GetMethodID (SafeHandle, name, signature); + return JniEnvironment.Members.GetMethodID (PeerReference, name, signature); } public JniInstanceMethodID GetCachedInstanceMethod (ref JniInstanceMethodID cachedMethod, string name, string signature) { AssertValid (); - if (cachedMethod != null && !cachedMethod.IsInvalid) + if (cachedMethod != null && cachedMethod.IsValid) return cachedMethod; var m = GetInstanceMethod (name, signature); - if (Interlocked.CompareExchange (ref cachedMethod, m, null) != null) - m.Dispose (); + if (Interlocked.CompareExchange (ref cachedMethod, m, null) != null) { + // No cleanup required; let the GC collect the unused instance + } return cachedMethod; } @@ -245,18 +254,19 @@ public JniStaticMethodID GetStaticMethod (string name, string signature) { AssertValid (); - return JniEnvironment.Members.GetStaticMethodID (SafeHandle, name, signature); + return JniEnvironment.Members.GetStaticMethodID (PeerReference, name, signature); } public JniStaticMethodID GetCachedStaticMethod (ref JniStaticMethodID cachedMethod, string name, string signature) { AssertValid (); - if (cachedMethod != null && !cachedMethod.IsInvalid) + if (cachedMethod != null && cachedMethod.IsValid) return cachedMethod; var m = GetStaticMethod (name, signature); - if (Interlocked.CompareExchange (ref cachedMethod, m, null) != null) - m.Dispose (); + if (Interlocked.CompareExchange (ref cachedMethod, m, null) != null) { + // No cleanup required; let the GC collect the unused instance + } return cachedMethod; } } diff --git a/src/Java.Interop/Java.Interop/JniWeakGlobalReference.cs b/src/Java.Interop/Java.Interop/JniWeakGlobalReference.cs index 957c662fc..bce79c71b 100644 --- a/src/Java.Interop/Java.Interop/JniWeakGlobalReference.cs +++ b/src/Java.Interop/Java.Interop/JniWeakGlobalReference.cs @@ -2,16 +2,31 @@ using System.Diagnostics; using System.Runtime.InteropServices; +#if FEATURE_HANDLES_ARE_SAFE_HANDLES + namespace Java.Interop { + sealed class JniWeakGlobalReference : JniReferenceSafeHandle { + + public JniWeakGlobalReference () + { + } + + public JniWeakGlobalReference (IntPtr handle) + { + SetHandle (handle); + } - public class JniWeakGlobalReference : JniReferenceSafeHandle { protected override bool ReleaseHandle () { - if (JniEnvironment.HasCurrent) - JniEnvironment.Current.JavaVM.JniHandleManager.DeleteWeakGlobalReference (handle); + if (JniEnvironment.HasCurrent) { + var r = new JniObjectReference (this, JniObjectReferenceType.WeakGlobal); + JniEnvironment.Current.JavaVM.JniHandleManager.DeleteWeakGlobalReference (ref r); + } return true; } } } + +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES diff --git a/src/Java.Interop/Tests/Interop-Tests.projitems b/src/Java.Interop/Tests/Interop-Tests.projitems index 39344e7da..5e219bd8f 100644 --- a/src/Java.Interop/Tests/Interop-Tests.projitems +++ b/src/Java.Interop/Tests/Interop-Tests.projitems @@ -39,7 +39,6 @@ - diff --git a/src/Java.Interop/Tests/Java.Interop/CallVirtualFromConstructorBase.cs b/src/Java.Interop/Tests/Java.Interop/CallVirtualFromConstructorBase.cs index 962d8d9d8..edd6a4724 100644 --- a/src/Java.Interop/Tests/Java.Interop/CallVirtualFromConstructorBase.cs +++ b/src/Java.Interop/Tests/Java.Interop/CallVirtualFromConstructorBase.cs @@ -15,11 +15,12 @@ public override JniPeerMembers JniPeerMembers { get {return _members;} } - public CallVirtualFromConstructorBase (int value) - : base (null, 0) + public unsafe CallVirtualFromConstructorBase (int value) + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { - using (SetSafeHandle ( - JniPeerMembers.InstanceMethods.StartGenericCreateInstance ("(I)V", GetType (), value), + var peer = JniPeerMembers.InstanceMethods.StartGenericCreateInstance ("(I)V", GetType (), value); + using (SetPeerReference ( + ref peer, JniHandleOwnership.Transfer)) { JniPeerMembers.InstanceMethods.FinishGenericCreateInstance ("(I)V", this, value); } diff --git a/src/Java.Interop/Tests/Java.Interop/InvokeVirtualFromConstructorTests.cs b/src/Java.Interop/Tests/Java.Interop/InvokeVirtualFromConstructorTests.cs index 487730d91..b87586142 100644 --- a/src/Java.Interop/Tests/Java.Interop/InvokeVirtualFromConstructorTests.cs +++ b/src/Java.Interop/Tests/Java.Interop/InvokeVirtualFromConstructorTests.cs @@ -14,7 +14,7 @@ public void InvokeVirtualFromConstructor () { using (var t = new CallVirtualFromConstructorDerived (42)) { Assert.IsTrue (t.Called); - Assert.IsNull (JavaVM.Current.PeekObject (t.SafeHandle)); + Assert.IsNull (JavaVM.Current.PeekObject (t.PeerReference)); } } } diff --git a/src/Java.Interop/Tests/Java.Interop/JavaExceptionTests.cs b/src/Java.Interop/Tests/Java.Interop/JavaExceptionTests.cs index 0c2d5cce0..8e15d65a7 100644 --- a/src/Java.Interop/Tests/Java.Interop/JavaExceptionTests.cs +++ b/src/Java.Interop/Tests/Java.Interop/JavaExceptionTests.cs @@ -33,7 +33,7 @@ public void InnerException () using (var t = new JniType ("java/lang/Throwable")) { var outer = CreateThrowable (t, "Outer Exception"); SetThrowableCause (t, outer, "Inner Exception"); - using (var e = new JavaException (outer, JniHandleOwnership.Transfer)) { + using (var e = new JavaException (ref outer, JniHandleOwnership.Transfer)) { Assert.IsNotNull (e.InnerException); Assert.AreEqual ("Inner Exception", e.InnerException.Message); Assert.AreEqual ("Outer Exception", e.Message); @@ -41,31 +41,34 @@ public void InnerException () } } - static unsafe JniLocalReference CreateThrowable (JniType type, string message) + static unsafe JniObjectReference CreateThrowable (JniType type, string message) { var c = type.GetConstructor ("(Ljava/lang/String;)V"); - using (var s = JniEnvironment.Strings.NewString (message)) { + var s = JniEnvironment.Strings.NewString (message); + try { var args = stackalloc JValue [1]; args [0] = new JValue (s); return type.NewObject (c, args); + } finally { + JniEnvironment.Handles.Dispose (ref s); } } - static void SetThrowableCause (JniType type, JniLocalReference outer, string message) + static void SetThrowableCause (JniType type, JniObjectReference outer, string message) { - using (var cause = CreateThrowable (type, message)) { - SetThrowableCause (type, outer, cause); - } + var cause = CreateThrowable (type, message); + SetThrowableCause (type, outer, cause); + JniEnvironment.Handles.Dispose (ref cause); } - static unsafe void SetThrowableCause (JniType type, JniLocalReference outer, JniReferenceSafeHandle inner) + static unsafe void SetThrowableCause (JniType type, JniObjectReference outer, JniObjectReference inner) { var a = stackalloc JValue [1]; a [0] = new JValue (inner); var i = type.GetInstanceMethod ("initCause", "(Ljava/lang/Throwable;)Ljava/lang/Throwable;"); - i.CallVirtualObjectMethod (outer, a) - .Dispose (); + var l = i.CallVirtualObjectMethod (outer, a); + JniEnvironment.Handles.Dispose (ref l); } [Test] @@ -75,8 +78,8 @@ public void InnerExceptionIsNotAProxy () var outer = CreateThrowable (t, "Outer Exception"); var ex = new InvalidOperationException ("Managed Exception!"); var exp = CreateJavaProxyThrowable (ex); - SetThrowableCause (t, outer, exp.SafeHandle); - using (var e = new JavaException (outer, JniHandleOwnership.Transfer)) { + SetThrowableCause (t, outer, exp.PeerReference); + using (var e = new JavaException (ref outer, JniHandleOwnership.Transfer)) { Assert.IsNotNull (e.InnerException); Assert.AreSame (ex, e.InnerException); } diff --git a/src/Java.Interop/Tests/Java.Interop/JavaObjectTest.cs b/src/Java.Interop/Tests/Java.Interop/JavaObjectTest.cs index 0cae53dec..33ef4b3e3 100644 --- a/src/Java.Interop/Tests/Java.Interop/JavaObjectTest.cs +++ b/src/Java.Interop/Tests/Java.Interop/JavaObjectTest.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using System.Threading; using Java.Interop; @@ -20,7 +21,7 @@ public void JavaReferencedInstanceSurvivesCollection () array.RegisterWithVM (); var w = new Thread (() => { var v = new JavaObject (); - oldHandle = v.SafeHandle.DangerousGetHandle (); + oldHandle = v.PeerReference.Handle; v.RegisterWithVM (); array [0] = v; }); @@ -30,9 +31,10 @@ public void JavaReferencedInstanceSurvivesCollection () GC.WaitForPendingFinalizers (); GC.WaitForPendingFinalizers (); var first = array [0]; - Assert.IsNotNull (JavaVM.Current.PeekObject (first.SafeHandle)); - var o = (JavaObject) JavaVM.Current.GetObject (first.SafeHandle, JniHandleOwnership.DoNotTransfer); - if (oldHandle != o.SafeHandle.DangerousGetHandle ()) { + Assert.IsNotNull (JavaVM.Current.PeekObject (first.PeerReference)); + var f = first.PeerReference; + var o = (JavaObject) JavaVM.Current.GetObject (ref f, JniHandleOwnership.DoNotTransfer); + if (oldHandle != o.PeerReference.Handle) { Console.WriteLine ("Yay, object handle changed; value survived a GC!"); } else { Console.WriteLine ("What is this, Android pre-ICS?!"); @@ -46,24 +48,24 @@ public void JavaReferencedInstanceSurvivesCollection () public void RegisterWithVM () { int registeredCount = JavaVM.Current.GetSurfacedObjects ().Count; - JniLocalReference l; + JniObjectReference l; JavaObject o; using (o = new JavaObject ()) { - l = o.SafeHandle.NewLocalRef (); - Assert.AreEqual (JniReferenceType.Local, o.SafeHandle.ReferenceType); + l = o.PeerReference.NewLocalRef (); + Assert.AreEqual (JniObjectReferenceType.Local, o.PeerReference.Type); Assert.AreEqual (registeredCount, JavaVM.Current.GetSurfacedObjects ().Count); Assert.IsNull (JavaVM.Current.PeekObject (l)); o.RegisterWithVM (); - Assert.AreNotSame (l, o.SafeHandle); - Assert.AreEqual (JniReferenceType.Global, o.SafeHandle.ReferenceType); - l.Dispose (); - l = o.SafeHandle.NewLocalRef (); + Assert.AreNotSame (l, o.PeerReference); + Assert.AreEqual (JniObjectReferenceType.Global, o.PeerReference.Type); + JniEnvironment.Handles.Dispose (ref l); + l = o.PeerReference.NewLocalRef (); Assert.AreEqual (registeredCount + 1, JavaVM.Current.GetSurfacedObjects ().Count); Assert.AreSame (o, JavaVM.Current.PeekObject (l)); } Assert.AreEqual (registeredCount, JavaVM.Current.GetSurfacedObjects ().Count); Assert.IsNull (JavaVM.Current.PeekObject (l)); - l.Dispose (); + JniEnvironment.Handles.Dispose (ref l); Assert.Throws (() => o.RegisterWithVM ()); } @@ -72,20 +74,21 @@ public void RegisterWithVM_ThrowsOnDuplicateEntry () { using (var original = new JavaObject ()) { original.RegisterWithVM (); - using (var alias = new JavaObject (original.SafeHandle, JniHandleOwnership.DoNotTransfer)) { - Assert.Throws (() => alias.RegisterWithVM ()); - } + var p = original.PeerReference; + var alias = new JavaObject (ref p, JniHandleOwnership.DoNotTransfer); + Assert.Throws (() => alias.RegisterWithVM ()); + alias.Dispose (); } } [Test] public void UnreferencedInstanceIsCollected () { - JniWeakGlobalReference oldHandle = null; + JniObjectReference oldHandle = new JniObjectReference (); WeakReference r = null; var t = new Thread (() => { var v = new JavaObject (); - oldHandle = v.SafeHandle.NewWeakGlobalRef (); + oldHandle = v.PeerReference.NewWeakGlobalRef (); r = new WeakReference (v); v.RegisterWithVM (); }); @@ -97,7 +100,7 @@ public void UnreferencedInstanceIsCollected () Assert.IsFalse (r.IsAlive); Assert.IsNull (r.Target); Assert.IsNull (JavaVM.Current.PeekObject (oldHandle)); - oldHandle.Dispose (); + JniEnvironment.Handles.Dispose (ref oldHandle); } [Test] @@ -136,7 +139,7 @@ public void ObjectDisposed () o.Dispose (); // These should not throw - var h = o.SafeHandle; + var h = o.PeerReference; var p = o.JniPeerMembers; // These should throw @@ -149,16 +152,17 @@ public void ObjectDisposed () [Test] public unsafe void Ctor () { - using (var t = new JniType ("java/lang/Object")) - using (var c = t.GetConstructor ("()V")) { + using (var t = new JniType ("java/lang/Object")) { + var c = t.GetConstructor ("()V"); var lref = t.NewObject (c, null); - using (var o = new JavaObject (lref, JniHandleOwnership.DoNotTransfer)) { - Assert.IsFalse (lref.IsInvalid); - Assert.AreNotSame (lref, o.SafeHandle); + Assert.IsTrue (lref.IsValid); + using (var o = new JavaObject (ref lref, JniHandleOwnership.DoNotTransfer)) { + Assert.IsTrue (lref.IsValid); + Assert.AreNotSame (lref, o.PeerReference); } - using (var o = new JavaObject (lref, JniHandleOwnership.Transfer)) { - Assert.IsTrue (lref.IsClosed); - Assert.AreNotSame (lref, o.SafeHandle); + using (var o = new JavaObject (ref lref, JniHandleOwnership.Transfer)) { + Assert.IsFalse (lref.IsValid); + Assert.AreNotSame (lref, o.PeerReference); } } } @@ -166,7 +170,8 @@ public unsafe void Ctor () [Test] public void Ctor_Exceptions () { - Assert.Throws (() => new JavaObject (new JniInvocationHandle (IntPtr.Zero), JniHandleOwnership.Transfer)); + var r = new JniObjectReference (); + Assert.Throws (() => new JavaObject (ref r, JniHandleOwnership.Transfer)); // Note: This may break if/when JavaVM provides "default" Assert.Throws (() => new JavaObjectWithNoJavaPeer ()); @@ -190,6 +195,11 @@ public void CrossThreadSharingRequresRegistration () [Test] public void CrossThreadSharingNotSupported () { + if (!HaveSafeHandles) { + Assert.Ignore ("SafeHandles not used. Cross-thread sharing can't be checked."); + return; + } + JavaObject o = null; var t = new Thread (() => o = new JavaObject ()); t.Start (); diff --git a/src/Java.Interop/Tests/Java.Interop/JavaVMFixture.cs b/src/Java.Interop/Tests/Java.Interop/JavaVMFixture.cs index 4b76c008a..0f73ff9f4 100644 --- a/src/Java.Interop/Tests/Java.Interop/JavaVMFixture.cs +++ b/src/Java.Interop/Tests/Java.Interop/JavaVMFixture.cs @@ -1,4 +1,7 @@ using System; +using System.Reflection; + +using Java.Interop; namespace Java.InteropTests { @@ -15,6 +18,8 @@ static JavaVMFixture () // that isn't where the jmethodID came from. public static bool CallNonvirtualVoidMethodSupportsDeclaringClassMismatch; + public static readonly bool HaveSafeHandles = typeof (JniObjectReference).GetField ("safeHandle", BindingFlags.NonPublic | BindingFlags.Instance) != null; + protected JavaVMFixture () { } diff --git a/src/Java.Interop/Tests/Java.Interop/JavaVMTest.cs b/src/Java.Interop/Tests/Java.Interop/JavaVMTest.cs index 3c78633ea..45a88d4a2 100644 --- a/src/Java.Interop/Tests/Java.Interop/JavaVMTest.cs +++ b/src/Java.Interop/Tests/Java.Interop/JavaVMTest.cs @@ -13,7 +13,7 @@ public class JavaVMTest : JavaVMFixture public void CreateJavaVM () { Assert.AreSame (JavaVM.Current, JavaVM.Current); - Assert.IsNotNull (JavaVM.Current.SafeHandle); + Assert.IsTrue (JavaVM.Current.InvocationPointer != IntPtr.Zero); Assert.IsNotNull (JniEnvironment.Current); } @@ -45,7 +45,7 @@ public JavaVMWithNullBuilder () { } - protected override bool TryGC (IJavaObject value, ref JniReferenceSafeHandle handle) + protected override bool TryGC (IJavaObject value, ref JniObjectReference handle) { throw new NotImplementedException (); } @@ -54,21 +54,22 @@ protected override bool TryGC (IJavaObject value, ref JniReferenceSafeHandle han [Test] public void GetRegisteredJavaVM_ExistingInstance () { - Assert.AreEqual (JavaVM.Current, JavaVM.GetRegisteredJavaVM (JavaVM.Current.SafeHandle)); + Assert.AreEqual (JavaVM.Current, JavaVM.GetRegisteredJavaVM (JavaVM.Current.InvocationPointer)); } [Test] public void GetObject_ReturnsAlias () { var local = new JavaObject (); - Assert.IsNull (JavaVM.Current.PeekObject (local.SafeHandle)); + Assert.IsNull (JavaVM.Current.PeekObject (local.PeerReference)); // GetObject must always return a value (unless handle is null, etc.). // However, since we didn't call local.RegisterWithVM(), // JavaVM.PeekObject() is null (asserted above), but GetObject() must // **still** return _something_. // In this case, it returns an _alias_. // TODO: "most derived type" alias generation. (Not relevant here, but...) - var alias = JavaVM.Current.GetObject (local.SafeHandle, JniHandleOwnership.DoNotTransfer); + var p = local.PeerReference; + var alias = JavaVM.Current.GetObject (ref p, JniHandleOwnership.DoNotTransfer); Assert.AreNotSame (local, alias); alias.Dispose (); local.Dispose (); @@ -84,9 +85,9 @@ public void GetObject_ReturnsNullWithNullHandle () [Test] public void GetObject_ReturnsRegisteredInstance () { - JniLocalReference lref; + JniObjectReference lref; using (var o = new JavaObject ()) { - lref = o.SafeHandle.NewLocalRef (); + lref = o.PeerReference.NewLocalRef (); Assert.IsNull (JavaVM.Current.PeekObject (lref)); o.RegisterWithVM (); Assert.AreSame (o, JavaVM.Current.PeekObject (lref)); @@ -95,24 +96,25 @@ public void GetObject_ReturnsRegisteredInstance () // but the wrapper instance has been disposed, and thus should // be unregistered, and thus unfindable. Assert.IsNull (JavaVM.Current.PeekObject (lref)); - lref.Dispose (); + JniEnvironment.Handles.Dispose (ref lref); } [Test] public void GetObject_ReturnsNullWithInvalidSafeHandle () { - var invalid = JniReferenceSafeHandle.Null; - Assert.IsNull (JavaVM.Current.GetObject (invalid, JniHandleOwnership.Transfer)); + var invalid = new JniObjectReference (); + Assert.IsNull (JavaVM.Current.GetObject (ref invalid, JniHandleOwnership.Transfer)); } [Test] public unsafe void GetObject_FindBestMatchType () { - using (var t = new JniType (TestType.JniTypeName)) - using (var c = t.GetConstructor ("()V")) - using (var o = t.NewObject (c, null)) - using (var w = JavaVM.Current.GetObject (o, JniHandleOwnership.DoNotTransfer)) { - Assert.AreEqual (typeof (TestType), w.GetType ()); + using (var t = new JniType (TestType.JniTypeName)) { + var c = t.GetConstructor ("()V"); + var o = t.NewObject (c, null); + using (var w = JavaVM.Current.GetObject (ref o, JniHandleOwnership.Transfer)) { + Assert.AreEqual (typeof (TestType), w.GetType ()); + } } } @@ -289,8 +291,9 @@ static void AssertGetJniMarshalInfoForPrimitiveType (string type) createLocalRef: type + ".CreateLocalRef"); var info = JavaVM.Current.GetJniMarshalInfoForType (typeof(T)); info.CreateJValue (default (T)); - using (var lref = info.CreateLocalRef (default (T))) - Assert.AreEqual (default (T), info.GetValueFromJni (lref, JniHandleOwnership.DoNotTransfer, null)); + var lref = info.CreateLocalRef (default (T)); + Assert.AreEqual (default (T), info.GetValueFromJni (ref lref, JniHandleOwnership.DoNotTransfer, null)); + JniEnvironment.Handles.Dispose (ref lref); } static void AssertGetJniMarshalInfoForPrimitiveArray () diff --git a/src/Java.Interop/Tests/Java.Interop/JniEnvironmentTests.cs b/src/Java.Interop/Tests/Java.Interop/JniEnvironmentTests.cs index 96bb01b61..b11bd6297 100644 --- a/src/Java.Interop/Tests/Java.Interop/JniEnvironmentTests.cs +++ b/src/Java.Interop/Tests/Java.Interop/JniEnvironmentTests.cs @@ -21,7 +21,7 @@ public void Constructor_SetsCurrent () Assert.AreSame (c, JniEnvironment.Current); Assert.AreSame (c, JniEnvironment.RootEnvironment); - using (var envp = new JniEnvironment (e.SafeHandle.DangerousGetHandle ())) { + using (var envp = new JniEnvironment (e.EnvironmentPointer)) { Assert.AreSame (envp, f.GetValue (null)); Assert.AreNotSame (envp, JniEnvironment.RootEnvironment); } @@ -32,25 +32,28 @@ public void Constructor_SetsCurrent () [Test] public void Dispose_ClearsLocalReferences () { - JniLocalReference lref; - using (var envp = new JniEnvironment (JniEnvironment.Current.SafeHandle.DangerousGetHandle ())) { - lref = (JniLocalReference) new JavaObject ().SafeHandle; - Assert.IsFalse (lref.IsClosed); + if (!HaveSafeHandles) { + Assert.Ignore ("SafeHandles aren't used, so magical disposal from a distance isn't supported."); + return; } - Assert.IsTrue (lref.IsClosed); + JniObjectReference lref; + using (var envp = new JniEnvironment (JniEnvironment.Current.EnvironmentPointer)) { + lref = new JavaObject ().PeerReference; + Assert.IsTrue (lref.IsValid); + } + Assert.IsFalse (lref.IsValid); } - [Test] public void Dispose_ClearsCurrentField () { var f = typeof (JniEnvironment).GetField ("current", BindingFlags.NonPublic | BindingFlags.Static); var e = JniEnvironment.Current; - var h = e.SafeHandle.DangerousGetHandle (); + var h = e.EnvironmentPointer; e.Dispose (); Assert.IsNull (f.GetValue (null)); Assert.IsNotNull (JniEnvironment.Current); - Assert.AreEqual (h, JniEnvironment.Current.SafeHandle.DangerousGetHandle ()); + Assert.AreEqual (h, JniEnvironment.Current.EnvironmentPointer); } [Test] @@ -58,10 +61,13 @@ public unsafe void Types_IsSameObject () { using (var t = new JniType ("java/lang/Object")) { var c = t.GetConstructor ("()V"); - using (var o = t.NewObject (c, null)) { + var o = t.NewObject (c, null); + try { using (var ot = JniEnvironment.Types.GetTypeFromInstance (o)) { - Assert.IsTrue (JniEnvironment.Types.IsSameObject (t.SafeHandle, ot.SafeHandle)); + Assert.IsTrue (JniEnvironment.Types.IsSameObject (t.PeerReference, ot.PeerReference)); } + } finally { + JniEnvironment.Handles.Dispose (ref o); } } } @@ -70,9 +76,9 @@ public unsafe void Types_IsSameObject () public void Types_GetJniTypeNameFromInstance () { using (var o = new JavaObject ()) - Assert.AreEqual ("java/lang/Object", JniEnvironment.Types.GetJniTypeNameFromInstance (o.SafeHandle)); + Assert.AreEqual ("java/lang/Object", JniEnvironment.Types.GetJniTypeNameFromInstance (o.PeerReference)); using (var o = new JavaInt32Array (0)) - Assert.AreEqual ("[I", JniEnvironment.Types.GetJniTypeNameFromInstance (o.SafeHandle)); + Assert.AreEqual ("[I", JniEnvironment.Types.GetJniTypeNameFromInstance (o.PeerReference)); } [Test] @@ -80,11 +86,16 @@ public unsafe void Handles_NewReturnToJniRef () { using (var t = new JniType ("java/lang/Object")) { var c = t.GetConstructor ("()V"); - using (var o = t.NewObject (c, null)) { + var o = t.NewObject (c, null); + try { + var n = o.NewLocalRef (); + JniEnvironment.Handles.Dispose (ref n); // warning: lref 'leak' var r = JniEnvironment.Handles.NewReturnToJniRef (o); - var h = new JniInvocationHandle (r); + var h = new JniObjectReference (r); Assert.AreEqual (JniEnvironment.Handles.GetIdentityHashCode (o), JniEnvironment.Handles.GetIdentityHashCode (h)); + } finally { + JniEnvironment.Handles.Dispose (ref o); } } } diff --git a/src/Java.Interop/Tests/Java.Interop/JniInstanceMethodIDTest.cs b/src/Java.Interop/Tests/Java.Interop/JniInstanceMethodIDTest.cs index 177212a83..ff89b747f 100644 --- a/src/Java.Interop/Tests/Java.Interop/JniInstanceMethodIDTest.cs +++ b/src/Java.Interop/Tests/Java.Interop/JniInstanceMethodIDTest.cs @@ -20,16 +20,19 @@ public unsafe void CallNonvirtualVoidMethod_WithBaseMethodIDAndDerivedType () var c = d.GetConstructor ("()V"); var g = d.GetInstanceField ("methodInvoked", "Z"); - using (var o = d.NewObject (c, null)) { + var o = d.NewObject (c, null); + try { if (JavaVMFixture.CallNonvirtualVoidMethodSupportsDeclaringClassMismatch) { - m.CallNonvirtualVoidMethod (o, d.SafeHandle); + m.CallNonvirtualVoidMethod (o, d.PeerReference); Assert.IsFalse (f.GetBooleanValue (o)); Assert.IsTrue (g.GetBooleanValue (o)); } else { - m.CallNonvirtualVoidMethod (o, d.SafeHandle); + m.CallNonvirtualVoidMethod (o, d.PeerReference); Assert.IsTrue (f.GetBooleanValue (o)); Assert.IsFalse (g.GetBooleanValue (o)); } + } finally { + JniEnvironment.Handles.Dispose (ref o); } } } diff --git a/src/Java.Interop/Tests/Java.Interop/JniReferenceSafeHandleTest.cs b/src/Java.Interop/Tests/Java.Interop/JniReferenceSafeHandleTest.cs index ddf659ac1..12d33a808 100644 --- a/src/Java.Interop/Tests/Java.Interop/JniReferenceSafeHandleTest.cs +++ b/src/Java.Interop/Tests/Java.Interop/JniReferenceSafeHandleTest.cs @@ -12,22 +12,22 @@ public class JniReferenceSafeHandleTest : JavaVMFixture { [Test] public void RefType () { - JniReferenceSafeHandle h; + JniObjectReference h; using (var t = new JniType ("java/lang/Object")) { - h = t.SafeHandle; - Assert.AreEqual (JniReferenceType.Local, h.ReferenceType); + h = t.PeerReference; + Assert.AreEqual (JniObjectReferenceType.Local, h.Type); } } [Test] public void RefType_ThrowsObjectDisposedException () { - JniReferenceSafeHandle h; + JniObjectReference h; using (var t = new JniType ("java/lang/Object")) { - h = t.SafeHandle; + h = t.PeerReference; } Assert.Throws (() => { - var ignore = h.ReferenceType; + var ignore = h.Type; GC.KeepAlive (ignore); }); } diff --git a/src/Java.Interop/Tests/Java.Interop/JniTypeTest.cs b/src/Java.Interop/Tests/Java.Interop/JniTypeTest.cs index adab1d2bb..962fe6e9c 100644 --- a/src/Java.Interop/Tests/Java.Interop/JniTypeTest.cs +++ b/src/Java.Interop/Tests/Java.Interop/JniTypeTest.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using Java.Interop; @@ -20,9 +21,12 @@ public unsafe void Sanity () var Integer_ctor = Integer_class.GetConstructor ("(I)V"); var Integer_intValue = Integer_class.GetInstanceMethod ("intValue", "()I"); - using (var o = Integer_class.NewObject (Integer_ctor, ctor_args)) { + var o = Integer_class.NewObject (Integer_ctor, ctor_args); + try { int v = Integer_intValue.CallVirtualInt32Method (o); Assert.AreEqual (42, v); + } finally { + JniEnvironment.Handles.Dispose (ref o); } } } @@ -47,7 +51,7 @@ public unsafe void Dispose_Exceptions () Assert.Throws (() => t.GetStaticMethod (null, null)); Assert.Throws (() => t.GetSuperclass ()); Assert.Throws (() => t.IsAssignableFrom (null)); - Assert.Throws (() => t.IsInstanceOfType (null)); + Assert.Throws (() => t.IsInstanceOfType (new JniObjectReference ())); Assert.Throws (() => t.RegisterWithVM ()); Assert.Throws (() => t.RegisterNativeMethods (null)); Assert.Throws (() => t.UnregisterNativeMethods ()); @@ -72,7 +76,7 @@ public void GetSuperclass () using (var s = new JniType ("java/lang/String")) { using (var st = s.GetSuperclass ()) { Assert.IsFalse (object.ReferenceEquals (t, st)); - Assert.IsTrue (JniEnvironment.Types.IsSameObject (t.SafeHandle, st.SafeHandle)); + Assert.IsTrue (JniEnvironment.Types.IsSameObject (t.PeerReference, st.PeerReference)); } } } @@ -93,7 +97,7 @@ public void IsInstanceOfType () { using (var t = new JniType ("java/lang/Object")) using (var b = new TestType ()) { - Assert.IsTrue (t.IsInstanceOfType (b.SafeHandle)); + Assert.IsTrue (t.IsInstanceOfType (b.PeerReference)); } } @@ -127,18 +131,23 @@ public unsafe void Name () { using (var Object_class = new JniType ("java/lang/Object")) using (var Class_class = new JniType ("java/lang/Class")) - using (var Class_getMethod = Class_class.GetInstanceMethod ("getMethod", "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;")) - using (var Method_class = new JniType ("java/lang/reflect/Method")) - using (var Method_getReturnType = Method_class.GetInstanceMethod ("getReturnType", "()Ljava/lang/Class;")) - using (var hashCode_str = JniEnvironment.Strings.NewString ("hashCode")) { + using (var Method_class = new JniType ("java/lang/reflect/Method")) { + var Class_getMethod = Class_class.GetInstanceMethod ("getMethod", "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); + var Method_getReturnType = Method_class.GetInstanceMethod ("getReturnType", "()Ljava/lang/Class;"); + var hashCode_str = JniEnvironment.Strings.NewString ("hashCode"); var hashCode_args = stackalloc JValue [1]; hashCode_args [0] = new JValue (hashCode_str); - using (var Object_hashCode = Class_getMethod.CallVirtualObjectMethod (Object_class.SafeHandle, hashCode_args)) - using (var Object_hashCode_rt = Method_getReturnType.CallVirtualObjectMethod (Object_hashCode, null)) { + var Object_hashCode = Class_getMethod.CallVirtualObjectMethod (Object_class.PeerReference, hashCode_args); + var Object_hashCode_rt = Method_getReturnType.CallVirtualObjectMethod (Object_hashCode, null); + try { Assert.AreEqual ("java/lang/Object", Object_class.Name); - using (var t = new JniType (Object_hashCode_rt, JniHandleOwnership.DoNotTransfer)) + using (var t = new JniType (ref Object_hashCode_rt, JniHandleOwnership.DoNotTransfer)) Assert.AreEqual ("I", t.Name); + } finally { + JniEnvironment.Handles.Dispose (ref hashCode_str); + JniEnvironment.Handles.Dispose (ref Object_hashCode); + JniEnvironment.Handles.Dispose (ref Object_hashCode_rt); } } } @@ -147,11 +156,16 @@ public unsafe void Name () public void RegisterWithVM () { using (var Object_class = new JniType ("java/lang/Object")) { - Assert.AreEqual (JniReferenceType.Local, Object_class.SafeHandle.ReferenceType); - var cur = Object_class.SafeHandle; + Assert.AreEqual (JniObjectReferenceType.Local, Object_class.PeerReference.Type); + var cur = Object_class.PeerReference; Object_class.RegisterWithVM (); - Assert.AreEqual (JniReferenceType.Global, Object_class.SafeHandle.ReferenceType); - Assert.IsTrue (cur.IsClosed); + Assert.AreEqual (JniObjectReferenceType.Global, Object_class.PeerReference.Type); + if (HaveSafeHandles) { + Assert.IsFalse (cur.IsValid); + } else { + Assert.IsTrue (cur.IsValid); // because struct+copy semantics; is actually no longer valid + } + Assert.IsTrue (Object_class.PeerReference.IsValid); } } @@ -159,9 +173,9 @@ public void RegisterWithVM () public void RegisterNativeMethods () { using (var TestType_class = new JniType ("com/xamarin/interop/CallNonvirtualBase")) { - Assert.AreEqual (JniReferenceType.Local, TestType_class.SafeHandle.ReferenceType); + Assert.AreEqual (JniObjectReferenceType.Local, TestType_class.PeerReference.Type); TestType_class.RegisterNativeMethods (); - Assert.AreEqual (JniReferenceType.Global, TestType_class.SafeHandle.ReferenceType); + Assert.AreEqual (JniObjectReferenceType.Global, TestType_class.PeerReference.Type); } } } diff --git a/src/Java.Interop/Tests/Java.Interop/LoggingJniHandleManagerDecorator.cs b/src/Java.Interop/Tests/Java.Interop/LoggingJniHandleManagerDecorator.cs index 78bbb866a..2b364dbd2 100644 --- a/src/Java.Interop/Tests/Java.Interop/LoggingJniHandleManagerDecorator.cs +++ b/src/Java.Interop/Tests/Java.Interop/LoggingJniHandleManagerDecorator.cs @@ -94,21 +94,24 @@ public void WriteLocalReferenceLine (string format, params object[] args) if (lrefLog == null) return; var message = string.Format (format, args); - lrefLog.WriteLine (message); + lock (lrefLog) { + lrefLog.WriteLine (message); + lrefLog.Flush (); + } } - public JniLocalReference CreateLocalReference (JniEnvironment environment, JniReferenceSafeHandle value) + public JniObjectReference CreateLocalReference (JniEnvironment environment, JniObjectReference value) { var newValue = manager.CreateLocalReference (environment, value); - if (lrefLog == null || newValue == null || newValue.IsClosed || newValue.IsInvalid) + if (lrefLog == null || !newValue.IsValid) return newValue; var t = Thread.CurrentThread; LogLref ("+l+ lrefc {0} obj-handle 0x{1}/{2} -> new-handle 0x{3}/{4} from thread '{5}'({6}){7}{8}", environment.LocalReferenceCount, - value.DangerousGetHandle ().ToString ("x"), - ToChar (value.ReferenceType), - newValue.DangerousGetHandle ().ToString ("x"), - ToChar (newValue.ReferenceType), + value.Handle.ToString ("x"), + ToChar (value.Type), + newValue.Handle.ToString ("x"), + ToChar (newValue.Type), t.Name, t.ManagedThreadId, Environment.NewLine, @@ -116,12 +119,12 @@ public JniLocalReference CreateLocalReference (JniEnvironment environment, JniRe return newValue; } - public void DeleteLocalReference (JniEnvironment environment, IntPtr value) + public void DeleteLocalReference (JniEnvironment environment, ref JniObjectReference value) { - if (lrefLog != null && value != IntPtr.Zero) { - LogDeleteLocalRef (environment, value); + if (lrefLog != null && value.IsValid) { + LogDeleteLocalRef (environment, value.Handle); } - manager.DeleteLocalReference (environment, value); + manager.DeleteLocalReference (environment, ref value); } void LogDeleteLocalRef (JniEnvironment environment, IntPtr value) @@ -137,28 +140,28 @@ void LogDeleteLocalRef (JniEnvironment environment, IntPtr value) new StackTrace (true)); } - public void CreatedLocalReference (JniEnvironment environment, JniLocalReference value) + public void CreatedLocalReference (JniEnvironment environment, JniObjectReference value) { manager.CreatedLocalReference (environment, value); - if (lrefLog == null || value == null || value.IsClosed || value.IsInvalid) + if (lrefLog == null || !value.IsValid) return; var t = Thread.CurrentThread; LogLref ("+l+ lrefc {0} -> new-handle 0x{1}/{2} from thread '{3}'({4}){5}{6}", environment.LocalReferenceCount, - value.DangerousGetHandle ().ToString ("x"), - ToChar (value.ReferenceType), + value.Handle.ToString ("x"), + ToChar (value.Type), t.Name, t.ManagedThreadId, Environment.NewLine, new StackTrace (true)); } - public IntPtr ReleaseLocalReference (JniEnvironment environment, JniLocalReference value) + public IntPtr ReleaseLocalReference (JniEnvironment environment, ref JniObjectReference value) { - if (lrefLog != null && value != null && !value.IsClosed && !value.IsInvalid) { - LogDeleteLocalRef (environment, value.DangerousGetHandle ()); + if (lrefLog != null && value.IsValid) { + LogDeleteLocalRef (environment, value.Handle); } - return manager.ReleaseLocalReference (environment, value); + return manager.ReleaseLocalReference (environment, ref value); } public void WriteGlobalReferenceLine (string format, params object[] args) @@ -166,22 +169,25 @@ public void WriteGlobalReferenceLine (string format, params object[] args) if (grefLog == null) return; var message = string.Format (format, args); - grefLog.WriteLine (message); + lock (grefLog) { + grefLog.WriteLine (message); + grefLog.Flush (); + } } - public JniGlobalReference CreateGlobalReference (JniReferenceSafeHandle value) + public JniObjectReference CreateGlobalReference (JniObjectReference value) { var newValue = manager.CreateGlobalReference (value); - if (grefLog == null || newValue == null || newValue.IsClosed || newValue.IsInvalid) + if (grefLog == null || !newValue.IsValid) return newValue; var t = Thread.CurrentThread; LogGref ("+g+ grefc {0} gwrefc {1} obj-handle 0x{2}/{3} -> new-handle 0x{4}/{5} from thread '{6}'({7}){8}{9}", GlobalReferenceCount, WeakGlobalReferenceCount, - value.DangerousGetHandle ().ToString ("x"), - ToChar (value.ReferenceType), - newValue.DangerousGetHandle ().ToString ("x"), - ToChar (newValue.ReferenceType), + value.Handle.ToString ("x"), + ToChar (value.Type), + newValue.Handle.ToString ("x"), + ToChar (newValue.Type), t.Name, t.ManagedThreadId, Environment.NewLine, @@ -189,37 +195,37 @@ public JniGlobalReference CreateGlobalReference (JniReferenceSafeHandle value) return newValue; } - public void DeleteGlobalReference (IntPtr value) + public void DeleteGlobalReference (ref JniObjectReference value) { - if (grefLog != null && value != IntPtr.Zero) { + if (grefLog != null && value.IsValid) { var t = Thread.CurrentThread; LogGref ("-g- grefc {0} gwrefc {1} handle 0x{2}/{3} from thread '{4}'({5}){6}{7}", GlobalReferenceCount, WeakGlobalReferenceCount, - value.ToString ("x"), + value.Handle.ToString ("x"), 'G', t.Name, t.ManagedThreadId, Environment.NewLine, new StackTrace (true)); } - manager.DeleteGlobalReference (value); + manager.DeleteGlobalReference (ref value); } - public JniWeakGlobalReference CreateWeakGlobalReference (JniReferenceSafeHandle value) + public JniObjectReference CreateWeakGlobalReference (JniObjectReference value) { var newValue = manager.CreateWeakGlobalReference (value); - if (grefLog == null || newValue != null || newValue.IsClosed || newValue.IsInvalid) { + if (grefLog == null || !newValue.IsValid) { return newValue; } var t = Thread.CurrentThread; LogGref ("+w+ grefc {0} gwrefc {1} obj-handle 0x{2}/{3} -> new-handle 0x{4}/{5} from thread '{6}'({7}){8}{9}", GlobalReferenceCount, WeakGlobalReferenceCount, - value.DangerousGetHandle ().ToString ("x"), - ToChar (value.ReferenceType), - newValue.DangerousGetHandle ().ToString ("x"), - ToChar (newValue.ReferenceType), + value.Handle.ToString ("x"), + ToChar (value.Type), + newValue.Handle.ToString ("x"), + ToChar (newValue.Type), t.Name, t.ManagedThreadId, Environment.NewLine, @@ -227,21 +233,21 @@ public JniWeakGlobalReference CreateWeakGlobalReference (JniReferenceSafeHandle return newValue; } - public void DeleteWeakGlobalReference (IntPtr value) + public void DeleteWeakGlobalReference (ref JniObjectReference value) { - if (grefLog != null && value != IntPtr.Zero) { + if (grefLog != null && value.IsValid) { var t = Thread.CurrentThread; LogGref ("-w- grefc {0} gwrefc {1} handle 0x{2}/{3} from thread '{4}'({5}){6}{7}", GlobalReferenceCount, WeakGlobalReferenceCount, - value.ToString ("x"), + value.Handle.ToString ("x"), 'W', t.Name, t.ManagedThreadId, Environment.NewLine, new StackTrace (true)); } - manager.DeleteWeakGlobalReference (value); + manager.DeleteWeakGlobalReference (ref value); } public void Dispose () @@ -276,13 +282,13 @@ void LogGref (string format, params object[] args) } } - static char ToChar (JniReferenceType type) + static char ToChar (JniObjectReferenceType type) { switch (type) { - case JniReferenceType.Global: return 'G'; - case JniReferenceType.Invalid: return 'I'; - case JniReferenceType.Local: return 'L'; - case JniReferenceType.WeakGlobal: return 'W'; + case JniObjectReferenceType.Global: return 'G'; + case JniObjectReferenceType.Invalid: return 'I'; + case JniObjectReferenceType.Local: return 'L'; + case JniObjectReferenceType.WeakGlobal: return 'W'; } return '*'; } diff --git a/src/Java.Interop/Tests/Java.Interop/TestType.cs b/src/Java.Interop/Tests/Java.Interop/TestType.cs index 8398d0edb..fe01dffa2 100644 --- a/src/Java.Interop/Tests/Java.Interop/TestType.cs +++ b/src/Java.Interop/Tests/Java.Interop/TestType.cs @@ -33,8 +33,8 @@ public TestType () { } - public TestType (JniReferenceSafeHandle handle, JniHandleOwnership transfer) - : base (handle, transfer) + public TestType (ref JniObjectReference reference, JniHandleOwnership transfer) + : base (ref reference, transfer) { } @@ -123,8 +123,12 @@ static IntPtr GetStringValueHandler (IntPtr jnienv, IntPtr n_self, int value) var self = JniEnvironment.Current.JavaVM.GetObject(n_self); try { var s = self.GetStringValue (value); - using (var r = JniEnvironment.Strings.NewString (s)) + var r = JniEnvironment.Strings.NewString (s); + try { return JniEnvironment.Handles.NewReturnToJniRef (r); + } finally { + JniEnvironment.Handles.Dispose (ref r); + } } finally { self.DisposeUnlessRegistered (); } @@ -144,9 +148,9 @@ public bool EqualsThis (IJavaObject value) { Assert.IsNotNull (value); Assert.AreNotSame (this, value); - Assert.IsTrue (JniEnvironment.Types.IsSameObject (SafeHandle, value.SafeHandle)); + Assert.IsTrue (JniEnvironment.Types.IsSameObject (PeerReference, value.PeerReference)); return value != null && !object.ReferenceEquals (value, this) && - JniEnvironment.Types.IsSameObject (SafeHandle, value.SafeHandle); + JniEnvironment.Types.IsSameObject (PeerReference, value.PeerReference); } public int GetInt32Value () diff --git a/src/Java.Runtime.Environment/Java.Interop/JniGC.cs b/src/Java.Runtime.Environment/Java.Interop/JniGC.cs index e52e05b62..7a9a280f2 100644 --- a/src/Java.Runtime.Environment/Java.Interop/JniGC.cs +++ b/src/Java.Runtime.Environment/Java.Interop/JniGC.cs @@ -6,8 +6,12 @@ static class JniGC { internal static void Collect () { - using (var runtime = JniRuntime.GetRuntime ()) + var runtime = JniRuntime.GetRuntime (); + try { JniRuntime.GC (runtime); + } finally { + JniEnvironment.Handles.Dispose (ref runtime); + } } } } diff --git a/src/Java.Runtime.Environment/Java.Interop/JniRuntime.cs b/src/Java.Runtime.Environment/Java.Interop/JniRuntime.cs index b07aec93d..df560ccc8 100644 --- a/src/Java.Runtime.Environment/Java.Interop/JniRuntime.cs +++ b/src/Java.Runtime.Environment/Java.Interop/JniRuntime.cs @@ -9,14 +9,14 @@ static JniType TypeRef { } static JniStaticMethodID _getRuntime; - internal static JniLocalReference GetRuntime () + internal static JniObjectReference GetRuntime () { return TypeRef.GetCachedStaticMethod (ref _getRuntime, "getRuntime", "()Ljava/lang/Runtime;") - .CallObjectMethod (TypeRef.SafeHandle); + .CallObjectMethod (TypeRef.PeerReference); } static JniInstanceMethodID _gc; - internal static void GC (JniLocalReference runtime) + internal static void GC (JniObjectReference runtime) { TypeRef.GetCachedInstanceMethod (ref _gc, "gc", "()V") .CallVirtualVoidMethod (runtime); diff --git a/src/Java.Runtime.Environment/Java.Interop/JreVM.cs b/src/Java.Runtime.Environment/Java.Interop/JreVM.cs index e5bde9eca..ccd0dd339 100644 --- a/src/Java.Runtime.Environment/Java.Interop/JreVM.cs +++ b/src/Java.Runtime.Environment/Java.Interop/JreVM.cs @@ -68,7 +68,7 @@ public class JreVM : JavaVM const string LibraryName = "jvm.dll"; [DllImport (LibraryName)] - static extern int JNI_CreateJavaVM (out JavaVMSafeHandle javavm, out JniEnvironmentSafeHandle jnienv, ref JavaVMInitArgs args); + static extern int JNI_CreateJavaVM (out IntPtr javavm, out IntPtr jnienv, ref JavaVMInitArgs args); [DllImport (LibraryName)] static extern int JNI_GetCreatedJavaVMs ([Out] IntPtr[] handles, int bufLen, out int nVMs); @@ -77,7 +77,7 @@ public class JreVM : JavaVM get { if (JavaVM.Current != null) return JavaVM.Current; - JavaVMSafeHandle h = null; + IntPtr h = IntPtr.Zero; int count = 0; foreach (var vmh in GetCreatedJavaVMHandles ()) { if (count++ == 0) @@ -91,12 +91,12 @@ public class JreVM : JavaVM if (r != null) return r; return new JreVM (new JreVMBuilder () { - VMHandle = h, + InvocationPointer = h, }); } } - public static IEnumerable GetCreatedJavaVMHandles () + public static IEnumerable GetCreatedJavaVMHandles () { int nVMs; int r = JNI_GetCreatedJavaVMs (null, 0, out nVMs); @@ -106,7 +106,7 @@ public static IEnumerable GetCreatedJavaVMHandles () r = JNI_GetCreatedJavaVMs (handles, handles.Length, out nVMs); if (r != 0) throw new InvalidOperationException ("JNI_GetCreatedJavaVMs() [take 2!] returned: " + r); - return handles.Select (h => new JavaVMSafeHandle (h)); + return handles; } static unsafe JreVMBuilder CreateJreVM (JreVMBuilder builder) @@ -114,7 +114,7 @@ static unsafe JreVMBuilder CreateJreVM (JreVMBuilder builder) if (builder == null) throw new ArgumentNullException ("builder"); - if (builder.VMHandle != null && !builder.VMHandle.IsInvalid) + if (builder.InvocationPointer != IntPtr.Zero) return builder; var args = new JavaVMInitArgs () { @@ -130,8 +130,8 @@ static unsafe JreVMBuilder CreateJreVM (JreVMBuilder builder) options [builder.Options.Count].optionString = classPath; fixed (JavaVMOption* popts = options) { args.options = (IntPtr) popts; - JavaVMSafeHandle javavm; - JniEnvironmentSafeHandle jnienv; + IntPtr javavm; + IntPtr jnienv; int r = JNI_CreateJavaVM (out javavm, out jnienv, ref args); if (r != 0) { var message = string.Format ( @@ -141,8 +141,8 @@ static unsafe JreVMBuilder CreateJreVM (JreVMBuilder builder) r); throw new NotSupportedException (message); } - builder.VMHandle = javavm; - builder.EnvironmentHandle = jnienv; + builder.InvocationPointer = javavm; + builder.EnvironmentPointer = jnienv; builder.DestroyVMOnDispose = true; return builder; } @@ -157,18 +157,16 @@ internal protected JreVM (JreVMBuilder builder) { } - protected override bool TryGC (IJavaObject value, ref JniReferenceSafeHandle handle) + protected override bool TryGC (IJavaObject value, ref JniObjectReference handle) { - System.Diagnostics.Debug.WriteLine ("# JreVM.TryGC"); - if (handle == null || handle.IsInvalid) + if (!handle.IsValid) return true; var wgref = handle.NewWeakGlobalRef (); - System.Diagnostics.Debug.WriteLine ("# JreVM.TryGC: wgref=0x{0}", wgref.DangerousGetHandle().ToString ("x"));; - handle.Dispose (); + JniEnvironment.Handles.Dispose (ref handle); JniGC.Collect (); handle = wgref.NewGlobalRef (); - System.Diagnostics.Debug.WriteLine ("# JreVM.TryGC: handle.IsInvalid={0}", handle.IsInvalid); - return handle == null || handle.IsInvalid; + JniEnvironment.Handles.Dispose (ref wgref); + return !handle.IsValid; } } } diff --git a/tests/PerformanceTests/JavaTiming.cs b/tests/PerformanceTests/JavaTiming.cs index 65783db1f..12a524a6e 100644 --- a/tests/PerformanceTests/JavaTiming.cs +++ b/tests/PerformanceTests/JavaTiming.cs @@ -19,81 +19,84 @@ internal static JniType TypeRef { } static JniInstanceMethodID Object_ctor; - static unsafe JniLocalReference _NewObject () + static unsafe JniObjectReference _NewObject () { TypeRef.GetCachedConstructor (ref Object_ctor, "()V"); return TypeRef.NewObject (Object_ctor, null); } - public JavaTiming () - : base (_NewObject (), JniHandleOwnership.Transfer) + public unsafe JavaTiming () + : base (ref *InvalidJniObjectReference, JniHandleOwnership.Invalid) { + var peer = _NewObject (); + using (SetPeerReference (ref peer, JniHandleOwnership.Transfer)) { + } } static JniStaticMethodID svm; public static void StaticVoidMethod () { TypeRef.GetCachedStaticMethod (ref svm, "StaticVoidMethod", "()V"); - svm.CallVoidMethod (TypeRef.SafeHandle); + svm.CallVoidMethod (TypeRef.PeerReference); } static JniStaticMethodID sim; public static int StaticIntMethod () { TypeRef.GetCachedStaticMethod (ref sim, "StaticIntMethod", "()I"); - return sim.CallInt32Method (TypeRef.SafeHandle); + return sim.CallInt32Method (TypeRef.PeerReference); } static JniStaticMethodID som; public static IJavaObject StaticObjectMethod () { TypeRef.GetCachedStaticMethod (ref som, "StaticObjectMethod", "()Ljava/lang/Object;"); - var lref = som.CallObjectMethod (TypeRef.SafeHandle); - return JniEnvironment.Current.JavaVM.GetObject (lref, JniHandleOwnership.Transfer); + var lref = som.CallObjectMethod (TypeRef.PeerReference); + return JniEnvironment.Current.JavaVM.GetObject (ref lref, JniHandleOwnership.Transfer); } static JniInstanceMethodID vvm; public virtual void VirtualVoidMethod () { TypeRef.GetCachedInstanceMethod (ref vvm, "VirtualVoidMethod", "()V"); - vvm.CallVirtualVoidMethod (SafeHandle); + vvm.CallVirtualVoidMethod (PeerReference); } static JniInstanceMethodID vim; public virtual int VirtualIntMethod () { TypeRef.GetCachedInstanceMethod (ref vim, "VirtualIntMethod", "()I"); - return vim.CallVirtualInt32Method (SafeHandle); + return vim.CallVirtualInt32Method (PeerReference); } static JniInstanceMethodID vom; public virtual IJavaObject VirtualObjectMethod () { TypeRef.GetCachedInstanceMethod (ref vom, "VirtualObjectMethod", "()Ljava/lang/Object;"); - var lref = vom.CallVirtualObjectMethod (SafeHandle); - return JniEnvironment.Current.JavaVM.GetObject (lref, JniHandleOwnership.Transfer); + var lref = vom.CallVirtualObjectMethod (PeerReference); + return JniEnvironment.Current.JavaVM.GetObject (ref lref, JniHandleOwnership.Transfer); } static JniInstanceMethodID fvm; public void FinalVoidMethod () { TypeRef.GetCachedInstanceMethod (ref fvm, "FinalVoidMethod", "()V"); - fvm.CallNonvirtualVoidMethod (SafeHandle, TypeRef.SafeHandle); + fvm.CallNonvirtualVoidMethod (PeerReference, TypeRef.PeerReference); } static JniInstanceMethodID fim; public int FinalIntMethod () { TypeRef.GetCachedInstanceMethod (ref fim, "FinalIntMethod", "()I"); - return fim.CallNonvirtualInt32Method (SafeHandle, TypeRef.SafeHandle); + return fim.CallNonvirtualInt32Method (PeerReference, TypeRef.PeerReference); } static JniInstanceMethodID fom; public IJavaObject FinalObjectMethod () { TypeRef.GetCachedInstanceMethod (ref fom, "FinalObjectMethod", "()Ljava/lang/Object;"); - var lref = vom.CallNonvirtualObjectMethod (SafeHandle, TypeRef.SafeHandle); - return JniEnvironment.Current.JavaVM.GetObject (lref, JniHandleOwnership.Transfer); + var lref = vom.CallNonvirtualObjectMethod (PeerReference, TypeRef.PeerReference); + return JniEnvironment.Current.JavaVM.GetObject (ref lref, JniHandleOwnership.Transfer); } static JniInstanceMethodID vim1; @@ -106,10 +109,10 @@ public unsafe int VirtualIntMethod1Args (int value) int r; if (GetType () == _members.ManagedPeerType) - r = vim1.CallVirtualInt32Method (SafeHandle, args); + r = vim1.CallVirtualInt32Method (PeerReference, args); else { JniInstanceMethodID m = JniPeerMembers.InstanceMethods.GetMethodID ("VirtualIntMethod1Args\u0000(I)I"); - r = m.CallNonvirtualInt32Method (SafeHandle, JniPeerMembers.JniPeerType.SafeHandle, args); + r = m.CallNonvirtualInt32Method (PeerReference, JniPeerMembers.JniPeerType.PeerReference, args); } return r; } @@ -138,10 +141,10 @@ public unsafe int VirtualIntMethod1Args (int[][][] value) var args = stackalloc JValue [1]; args [0] = new JValue (native_array); if (GetType () == _members.ManagedPeerType) - r = vim1_a.CallVirtualInt32Method (SafeHandle, args); + r = vim1_a.CallVirtualInt32Method (PeerReference, args); else { JniInstanceMethodID m = JniPeerMembers.InstanceMethods.GetMethodID ("VirtualIntMethod1Args\u0000([[[I)I"); - r = m.CallNonvirtualInt32Method (SafeHandle, JniPeerMembers.JniPeerType.SafeHandle, args); + r = m.CallNonvirtualInt32Method (PeerReference, JniPeerMembers.JniPeerType.PeerReference, args); } native_array.CopyTo (value, 0); } @@ -173,7 +176,7 @@ public static unsafe void StaticVoidMethod1Args (IJavaObject obj1) "(Ljava/lang/Object;)V"); var args = stackalloc JValue [1]; args [0] = new JValue (obj1); - svm1.CallVoidMethod (TypeRef.SafeHandle, args); + svm1.CallVoidMethod (TypeRef.PeerReference, args); } static JniStaticMethodID svm2; @@ -184,7 +187,7 @@ public static unsafe void StaticVoidMethod2Args (IJavaObject obj1, IJavaObject o var args = stackalloc JValue [2]; args [0] = new JValue (obj1); args [1] = new JValue (obj2); - svm2.CallVoidMethod (TypeRef.SafeHandle, args); + svm2.CallVoidMethod (TypeRef.PeerReference, args); } static JniStaticMethodID svm3; @@ -196,7 +199,7 @@ public static unsafe void StaticVoidMethod3Args (IJavaObject obj1, IJavaObject o args [0] = new JValue (obj1); args [1] = new JValue (obj2); args [1] = new JValue (obj3); - svm2.CallVoidMethod (TypeRef.SafeHandle, args); + svm2.CallVoidMethod (TypeRef.PeerReference, args); } static JniStaticMethodID svmi1; @@ -205,7 +208,7 @@ public static unsafe void StaticVoidMethod1IArgs (int obj1) TypeRef.GetCachedStaticMethod (ref svmi1, "StaticVoidMethod1IArgs", "(I)V"); var args = stackalloc JValue [1]; args [0] = new JValue (obj1); - svmi1.CallVoidMethod (TypeRef.SafeHandle, args); + svmi1.CallVoidMethod (TypeRef.PeerReference, args); } static JniStaticMethodID svmi2; @@ -215,7 +218,7 @@ public static unsafe void StaticVoidMethod2IArgs (int obj1, int obj2) var args = stackalloc JValue [2]; args [0] = new JValue (obj1); args [1] = new JValue (obj2); - svmi1.CallVoidMethod (TypeRef.SafeHandle, args); + svmi1.CallVoidMethod (TypeRef.PeerReference, args); } static JniStaticMethodID svmi3; @@ -226,43 +229,43 @@ public static unsafe void StaticVoidMethod3IArgs (int obj1, int obj2, int obj3) args [0] = new JValue (obj1); args [1] = new JValue (obj2); args [1] = new JValue (obj3); - svmi1.CallVoidMethod (TypeRef.SafeHandle, args); + svmi1.CallVoidMethod (TypeRef.PeerReference, args); } const string toString_name = "toString"; const string toString_sig = "()Ljava/lang/String;"; static JniInstanceMethodID toString; - public JniLocalReference Timing_ToString_Traditional () + public JniObjectReference Timing_ToString_Traditional () { TypeRef.GetCachedInstanceMethod (ref toString, toString_name, toString_sig); - return toString.CallVirtualObjectMethod (SafeHandle); + return toString.CallVirtualObjectMethod (PeerReference); } - public JniLocalReference Timing_ToString_NoCache () + public JniObjectReference Timing_ToString_NoCache () { - using (var m = TypeRef.GetInstanceMethod (toString_name, toString_sig)) - return m.CallVirtualObjectMethod (SafeHandle); + var m = TypeRef.GetInstanceMethod (toString_name, toString_sig); + return m.CallVirtualObjectMethod (PeerReference); } static Dictionary dictInstanceMethods = new Dictionary(); - public JniLocalReference Timing_ToString_DictWithLock () + public JniObjectReference Timing_ToString_DictWithLock () { JniInstanceMethodID m; lock (dictInstanceMethods) { - if (!dictInstanceMethods.TryGetValue (toString_name + toString_sig, out m) || m.IsInvalid) + if (!dictInstanceMethods.TryGetValue (toString_name + toString_sig, out m)) dictInstanceMethods.Add (toString_name + toString_sig, m = TypeRef.GetInstanceMethod (toString_name, toString_sig)); } - return m.CallVirtualObjectMethod (SafeHandle); + return m.CallVirtualObjectMethod (PeerReference); } static ConcurrentDictionary nolockInstanceMethods = new ConcurrentDictionary(); - public JniLocalReference Timing_ToString_DictWithNoLock () + public JniObjectReference Timing_ToString_DictWithNoLock () { var m = nolockInstanceMethods.AddOrUpdate (toString_name + toString_sig, s => TypeRef.GetInstanceMethod (toString_name, toString_sig), - (s, c) => c.IsInvalid ? TypeRef.GetInstanceMethod (toString_name, toString_sig) : c); - return m.CallVirtualObjectMethod (SafeHandle); + (s, c) => c ?? TypeRef.GetInstanceMethod (toString_name, toString_sig)); + return m.CallVirtualObjectMethod (PeerReference); } } } diff --git a/tests/PerformanceTests/TimingTests.cs b/tests/PerformanceTests/TimingTests.cs index b0e35d76e..715c4602e 100644 --- a/tests/PerformanceTests/TimingTests.cs +++ b/tests/PerformanceTests/TimingTests.cs @@ -27,10 +27,10 @@ class JniMethodInvocationOverheadTiming : Java.InteropTests.JavaVMFixture { static extern IntPtr foo_ptr_timing (); [DllImport (LibName)] - static extern void foo_init (JniEnvironmentSafeHandle env); + static extern void foo_init (IntPtr env); [DllImport (LibName)] - static extern void foo_get_native_jni_timings (JniEnvironmentSafeHandle env, int count, JniReferenceSafeHandle klass, JniReferenceSafeHandle self, long[] jniTimes); + static extern void foo_get_native_jni_timings (IntPtr env, int count, IntPtr klass, IntPtr self, long[] jniTimes); struct FooMethods { public IntPtr instance_void; @@ -85,9 +85,9 @@ public unsafe void MethodInvocationTiming () var transfer = JniHandleOwnership.Transfer; - var jobj1 = new JavaObject (Object_class.NewObject (Object_init, null), transfer); - var jobj2 = new JavaObject (Object_class.NewObject (Object_init, null), transfer); - var jobj3 = new JavaObject (Object_class.NewObject (Object_init, null), transfer); + var jobj1 = CreateJavaObject (Object_class.NewObject (Object_init, null), transfer); + var jobj2 = CreateJavaObject (Object_class.NewObject (Object_init, null), transfer); + var jobj3 = CreateJavaObject (Object_class.NewObject (Object_init, null), transfer); var obj1 = new SomeClass (); var obj2 = new SomeClass (); @@ -229,10 +229,10 @@ public unsafe void MethodInvocationTiming () var total = Stopwatch.StartNew (); - foo_init (JniEnvironment.Current.SafeHandle); + foo_init (JniEnvironment.Current.EnvironmentPointer); var jniTimes = new long [comparisons.Length]; - foo_get_native_jni_timings (JniEnvironment.Current.SafeHandle, count, JavaTiming.TypeRef.SafeHandle, j.SafeHandle, jniTimes); + foo_get_native_jni_timings (JniEnvironment.Current.EnvironmentPointer, count, JavaTiming.TypeRef.PeerReference.Handle, j.PeerReference.Handle, jniTimes); int jniTimeIndex = 0; foreach (var c in comparisons) { @@ -280,6 +280,11 @@ public unsafe void MethodInvocationTiming () Console.WriteLine ("## {0} Timing: {1}", nameof (MethodInvocationTiming), total.Elapsed); } + static JavaObject CreateJavaObject (JniObjectReference value, JniHandleOwnership transfer) + { + return new JavaObject (ref value, transfer); + } + static Action A (Action a) { return a; @@ -318,23 +323,31 @@ public void MethodLookupTiming () using (var o = new JavaTiming ()) { var tt = Stopwatch.StartNew (); - for (int i = 0; i < count; ++i) - o.Timing_ToString_Traditional ().Dispose (); + for (int i = 0; i < count; ++i) { + var s = o.Timing_ToString_Traditional (); + JniEnvironment.Handles.Dispose (ref s); + } tt.Stop (); var ta = Stopwatch.StartNew (); - for (int i = 0; i < count; ++i) - o.Timing_ToString_NoCache ().Dispose (); + for (int i = 0; i < count; ++i) { + var s = o.Timing_ToString_NoCache (); + JniEnvironment.Handles.Dispose (ref s); + } ta.Stop (); var td = Stopwatch.StartNew (); - for (int i = 0; i < count; ++i) - o.Timing_ToString_DictWithLock ().Dispose (); + for (int i = 0; i < count; ++i) { + var s = o.Timing_ToString_DictWithLock ();; + JniEnvironment.Handles.Dispose (ref s); + } td.Stop (); var tc = Stopwatch.StartNew (); - for (int i = 0; i < count; ++i) - o.Timing_ToString_DictWithNoLock ().Dispose (); + for (int i = 0; i < count; ++i) { + var s = o.Timing_ToString_DictWithNoLock (); + JniEnvironment.Handles.Dispose (ref s); + } tc.Stop (); Console.WriteLine ("Method Lookup + Invoke Timing:"); @@ -417,11 +430,11 @@ public void ObjectArrayEnumerationTiming () var methodHandles = new List (); using (var Arrays_class = new JniType ("java/util/Arrays")) { - var lrefMethods = Class_getMethods.CallVirtualObjectMethod (Arrays_class.SafeHandle); + var lrefMethods = Class_getMethods.CallVirtualObjectMethod (Arrays_class.PeerReference); Console.WriteLine ("# {0}: java.util.Arrays.class.getMethods() Timing: {1}", nameof (ObjectArrayEnumerationTiming), total.Elapsed); var methodsTiming = Stopwatch.StartNew (); - using (var methods = new JavaObjectArray (lrefMethods, JniHandleOwnership.DoNotTransfer)) { + using (var methods = new JavaObjectArray (ref lrefMethods, JniHandleOwnership.DoNotTransfer)) { foreach (var method in methods) { methodHandles.Add (method); } @@ -435,7 +448,7 @@ public void ObjectArrayEnumerationTiming () int len = JniEnvironment.Arrays.GetArrayLength (lrefMethods); for (int i = 0; i < len; ++i) { var v = JniEnvironment.Arrays.GetObjectArrayElement (lrefMethods, i); - methodHandlesGO.Add (vm.GetObject (v, JniHandleOwnership.Transfer)); + methodHandlesGO.Add (vm.GetObject (ref v, JniHandleOwnership.Transfer)); } methodsTiming.Stop (); Console.WriteLine ("# methodHandles(JavaVM.GetObject) creation timing: {0} Count={1}", methodsTiming.Elapsed, methodHandles.Count); @@ -448,7 +461,7 @@ public void ObjectArrayEnumerationTiming () len = JniEnvironment.Arrays.GetArrayLength (lrefMethods); for (int i = 0; i < len; ++i) { var v = JniEnvironment.Arrays.GetObjectArrayElement (lrefMethods, i); - methodHandlesAr.Add (new JavaObject (v, JniHandleOwnership.Transfer)); + methodHandlesAr.Add (new JavaObject (ref v, JniHandleOwnership.Transfer)); } methodsTiming.Stop (); Console.WriteLine ("# methodHandles(JavaObject[]) creation timing: {0} Count={1}", methodsTiming.Elapsed, methodHandles.Count); @@ -458,35 +471,42 @@ public void ObjectArrayEnumerationTiming () methodsTiming = Stopwatch.StartNew (); - var methodHandlesGR = new List (); + var methodHandlesGR = new List (); len = JniEnvironment.Arrays.GetArrayLength (lrefMethods); for (int i = 0; i < len; ++i) { - using (var v = JniEnvironment.Arrays.GetObjectArrayElement (lrefMethods, i)) - methodHandlesGR.Add (v.NewGlobalRef ()); + var v = JniEnvironment.Arrays.GetObjectArrayElement (lrefMethods, i); + methodHandlesGR.Add (v.NewGlobalRef ()); + JniEnvironment.Handles.Dispose (ref v); } methodsTiming.Stop (); Console.WriteLine ("# methodHandles(JniGlobalReference) creation timing: {0} Count={1}", methodsTiming.Elapsed, methodHandles.Count); - foreach (var h in methodHandlesGR) - h.Dispose (); + for (int i = 0; i < methodHandlesGR.Count; ++i) { + var h = methodHandlesGR [i]; + JniEnvironment.Handles.Dispose (ref h); + methodHandlesGR [i] = h; + } - lrefMethods.Dispose (); + JniEnvironment.Handles.Dispose (ref lrefMethods); } foreach (var method in methodHandles) { var lookupTiming = Stopwatch.StartNew (); - var name = JniEnvironment.Strings.ToString (Method_getName.CallVirtualObjectMethod (method.SafeHandle), JniHandleOwnership.Transfer); - using (var rt = new JniType (Method_getReturnType.CallVirtualObjectMethod (method.SafeHandle), JniHandleOwnership.Transfer)) { + var n_name = Method_getName.CallVirtualObjectMethod (method.PeerReference); + var name = JniEnvironment.Strings.ToString (ref n_name, JniHandleOwnership.Transfer); + var n_rt = Method_getReturnType.CallVirtualObjectMethod (method.PeerReference); + using (var rt = new JniType (ref n_rt, JniHandleOwnership.Transfer)) { } var parameterTiming = Stopwatch.StartNew (); var enumTime = new TimeSpan (); - var lrefPs = Method_getParameterTypes.CallVirtualObjectMethod (method.SafeHandle); + var lrefPs = Method_getParameterTypes.CallVirtualObjectMethod (method.PeerReference); Stopwatch cleanup; - using (var ps = new JavaObjectArray(lrefPs, JniHandleOwnership.Transfer)) { + using (var ps = new JavaObjectArray(ref lrefPs, JniHandleOwnership.Transfer)) { var enumSw = Stopwatch.StartNew (); foreach (var p in ps) { - using (var pt = new JniType (p.SafeHandle, JniHandleOwnership.DoNotTransfer)) { + var h = p.PeerReference; + using (var pt = new JniType (ref h, JniHandleOwnership.DoNotTransfer)) { } } enumSw.Stop (); @@ -571,20 +591,19 @@ public unsafe void ObjectCreationTiming () Stopwatch allocTime, newObjectTime, newTime, getObjectTime; - using (var Object_class = new JniType ("java/lang/Object")) - using (var Object_init = Object_class.GetConstructor ("()V")) - { + using (var Object_class = new JniType ("java/lang/Object")) { + var Object_init = Object_class.GetConstructor ("()V"); allocTime = Stopwatch.StartNew (); for (int i = 0; i < C; ++i) { - using (var h = Object_class.AllocObject ()) { - } + var h = Object_class.AllocObject (); + JniEnvironment.Handles.Dispose (ref h); } allocTime.Stop (); newObjectTime = Stopwatch.StartNew (); for (int i = 0; i < C; ++i) { - using (var h = Object_class.NewObject (Object_init, null)) { - } + var h = Object_class.NewObject (Object_init, null); + JniEnvironment.Handles.Dispose (ref h); } newObjectTime.Stop (); @@ -607,8 +626,8 @@ public unsafe void ObjectCreationTiming () var rlist = new List (C); getObjectTime = Stopwatch.StartNew (); for (int i = 0; i < C; ++i) { - var h = JniEnvironment.Arrays.GetObjectArrayElement (strings.SafeHandle, i); - var o = vm.GetObject (h, JniHandleOwnership.Transfer); + var h = JniEnvironment.Arrays.GetObjectArrayElement (strings.PeerReference, i); + var o = vm.GetObject (ref h, JniHandleOwnership.Transfer); rlist.Add (o); } getObjectTime.Stop (); diff --git a/tests/invocation-overhead/Makefile b/tests/invocation-overhead/Makefile new file mode 100644 index 000000000..5c9d604b9 --- /dev/null +++ b/tests/invocation-overhead/Makefile @@ -0,0 +1,10 @@ +all: test-overheads.exe test-overheads-xa.exe + +test-overheads.exe: test-overheads.cs jni.cs + mcs -out:$@ -unsafe -d:FEATURE_HANDLES_ARE_SAFE_HANDLES -d:FEATURE_HANDLES_ARE_INTPTRS $^ + +test-overheads-xa.exe: test-overheads.cs jni-xa.cs + mcs -out:$@ -unsafe -d:XA -d:FEATURE_HANDLES_ARE_SAFE_HANDLES -d:FEATURE_HANDLES_ARE_INTPTRS $^ + +run: + mono --debug test-overheads.exe \ No newline at end of file diff --git a/tests/invocation-overhead/README.md b/tests/invocation-overhead/README.md new file mode 100644 index 000000000..6c6ed3189 --- /dev/null +++ b/tests/invocation-overhead/README.md @@ -0,0 +1,92 @@ +Timing: + +The original Java.Interop effort weanted a type-safe and simple binding. As such, it usedd SafeHandles. + +As the Xamarin.Forms team has turned their attention to profiling +Xamarin.Forms apps, and finding major Xamarin.Android-related +performance issues, performance needs to be considered. + +For example, GC object allocation is a MAJOR concern for them; +ideally, you could have ZERO GC ALLOCATIONS performed when +invoking a Java method. + +SafeHandles don't fit "nicely" in that world; every method that returns a SafeHandle ALLOCATES A NEW GC OBJECT. + +So...how bad is it? + +What's in this directory is a VERY TRIMMED DOWN Java.Interop layer. +Really, it's NOT Java.Interop; it's the core generated JniEnvironment.g.cs (as `jni.cs`) +with code for both SafeHandles and IntPtr-oriented invocation strategies. + +The test? Invoke java.util.Arrays.binarySearch(int[], int) for 10,000,000 times. + +Result: + + # SafeHandle timing: 00:00:02.7913432 + # Average Invocation: 0.00027913432ms + # JniObjectReference timing: 00:00:01.9809859 + # Average Invocation: 0.00019809859ms + +Basically, with a `JniObjectReference` struct-oriented approach, SafeHandles take ~1.4x as long to run. +Rephrased: the JniObjectReference struct takes 70% of the time of SafeHandles. + +Ouch. + +What about the current Xamarin.Android "all IntPtrs all the time!" approach? + + # SafeHandle timing: 00:00:02.8118485 + # Average Invocation: 0.00028118485ms + # JniObjectReference timing: 00:00:02.0061727 + # Average Invocation: 0.00020061727ms + +The performance difference is comparable -- SafeHandles take ~1.4x as long to run, or +IntPtrs take ~70% as long as using SafeHandles. + +Interesting -- but probably not *that* interesting -- is that in an absolute sense, the `JniObjectReference` +struct was *faster* than the `IntPtr` approach, even though `JniObjectReference` contains *both* an `IntPtr` +*and* an enum -- and is thus bigger! + +That doesn't make any sense. + +Regardless, `JniObjectReference` doesn't appear to be *slower*, and thus should be a viable option here. + +--- + +Does this mean SafeHandle-oriented use should die a horrible flaming death? + +Perhaps. + +However, I still fear a future precise-stack-scanning world, or handle-swizzling, or... +and SafeHandles and HandleRefs are the only ways I know of to help support precise GCs. +Unfortunately, `HandleRef` is NOT in *any* PCL profile, and thus isn't viable either +while fulfilling the other desires/requirements of Java.Interop, so that just leaves +`SafeHandle`s. + +Which means, for "sanity", we'd want an API that can support both...at least with minor variations. + +Meaning we "abstract out" the actual handle representation. + +This isn't entirely straightforward; the point to an abstraction would be a stable API. + +For example, what should `JNIEnv::CallObjectMethod()` return? It needs to return a `jobject`, +in some form, and that type itself needs to be part of the stable API. + +We could say that it should be `IJavaObject` (or whatever), but the low-level wrappers shouldn't be *hidden*. +Sometimes you don't want that marshaling overhead! (See also recent Java.Interop.Dynamic-related commits). + +The origial SafeHandle idea was that `JNIEnv::CallObjectMethod()` would return `JniLocalReference`, +but that's clearly no good now. + +I think what we could instead do is have `JniObjectReference` as the stable API. +When supporting SafeHandles as a backend, JniObjectReference can contain the SafeHandle +as a member instead of the current IntPtr, thus preserving compatibility. + +That handles return types. What about arguments? + +The wonderful thing about SafeHandles (see above waxing poetic about precise GCs) is that +when passed as an argument to native code they'll be automagically pinned and kept alive. +(`HandleRef` does that too, but no `HandleRef` in PCL!) + +The current (above) timing comparison uses `IntPtr` for arguments. + +We should standardize on `JniObjectReference` (again). diff --git a/tests/invocation-overhead/jni-xa.cs b/tests/invocation-overhead/jni-xa.cs new file mode 100644 index 000000000..dcc7ce7bb --- /dev/null +++ b/tests/invocation-overhead/jni-xa.cs @@ -0,0 +1,9470 @@ +// Generated file; DO NOT EDIT! +// +// To make changes, edit monodroid/tools/jnienv-gen-interop and rerun + +#if !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS +#define FEATURE_HANDLES_ARE_SAFE_HANDLES +#endif // !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS +#define _NAMESPACE_PER_HANDLE +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS + +using System; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; + +using Java.Interop; + +#if FEATURE_HANDLES_ARE_INTPTRS + using JNIEnvPtr = System.IntPtr; + using jinstanceFieldID = System.IntPtr; + using jstaticFieldID = System.IntPtr; + using jinstanceMethodID = System.IntPtr; + using jstaticMethodID = System.IntPtr; + using jobject = System.IntPtr; +#endif // FEATURE_HANDLES_ARE_INTPTRS + +namespace Java.Interop { + [StructLayout (LayoutKind.Sequential)] + partial struct JniNativeInterfaceStruct { + +#pragma warning disable 0649 // Field is assigned to, and will always have its default value `null`; ignore as it'll be set in native code. +#pragma warning disable 0169 // Field never used; ignore since these fields make the structure have the right layout. + private IntPtr reserved0; // void* + private IntPtr reserved1; // void* + private IntPtr reserved2; // void* + private IntPtr reserved3; // void* + public IntPtr GetVersion; // jint (*GetVersion)(JNIEnv*); + public IntPtr DefineClass; // jclass (*DefineClass)(JNIEnv*, const char, jobject, const jbyte*, jsize); + public IntPtr FindClass; // jclass (*FindClass)(JNIEnv*, const char*); + public IntPtr FromReflectedMethod; // jmethodID (*FromReflectedMethod)(JNIEnv*, jobject); + public IntPtr FromReflectedField; // jfieldID (*FromReflectedField)(JNIEnv*, jobject); + public IntPtr ToReflectedMethod; // jobject (*ToReflectedMethod)(JNIEnv*, jclass, jmethodID, jboolean); + public IntPtr GetSuperclass; // jclass (*GetSuperclass)(JNIEnv*, jclass); + public IntPtr IsAssignableFrom; // jboolean (*IsAssignableFrom)(JNIEnv*, jclass, jclass); + public IntPtr ToReflectedField; // jobject (*ToReflectedField)(JNIEnv*, jclass, jfieldID, jboolean); + public IntPtr Throw; // jint (*Throw)(JNIEnv*, jthrowable); + public IntPtr ThrowNew; // jint (*ThrowNew)(JNIEnv*, jclass, const char*); + public IntPtr ExceptionOccurred; // jthrowable (*ExceptionOccurred)(JNIEnv*); + public IntPtr ExceptionDescribe; // void (*ExceptionDescribe)(JNIEnv*); + public IntPtr ExceptionClear; // void (*ExceptionClear)(JNIEnv*); + public IntPtr FatalError; // void (*FatalError)(JNIEnv*, const char*); + public IntPtr PushLocalFrame; // jint (*PushLocalFrame)(JNIEnv*, jint); + public IntPtr PopLocalFrame; // jobject (*PopLocalFrame)(JNIEnv*, jobject); + public IntPtr NewGlobalRef; // jobject (*NewGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteGlobalRef; // void (*DeleteGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteLocalRef; // void (*DeleteLocalRef)(JNIEnv*, jobject); + public IntPtr IsSameObject; // jboolean (*IsSameObject)(JNIEnv*, jobject, jobject); + public IntPtr NewLocalRef; // jobject (*NewLocalRef)(JNIEnv*, jobject); + public IntPtr EnsureLocalCapacity; // jint (*EnsureLocalCapacity)(JNIEnv*, jint); + public IntPtr AllocObject; // jobject (*AllocObject)(JNIEnv*, jclass); + public IntPtr NewObject; // jobject (*NewObject)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr NewObjectV; // jobject (*NewObjectV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr NewObjectA; // jobject (*NewObjectA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr GetObjectClass; // jclass (*GetObjectClass)(JNIEnv*, jobject); + public IntPtr IsInstanceOf; // jboolean (*IsInstanceOf)(JNIEnv*, jobject, jclass); + public IntPtr GetMethodID; // jmethodID (*GetMethodID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr CallObjectMethod; // jobject (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallObjectMethodV; // jobject (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallObjectMethodA; // jobject (*CallObjectMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallBooleanMethod; // jboolean (*CallBooleanMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallBooleanMethodV; // jboolean (*CallBooleanMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallBooleanMethodA; // jboolean (*CallBooleanMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallSByteMethod; // jbyte (*CallByteMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallSByteMethodV; // jbyte (*CallByteMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallSByteMethodA; // jbyte (*CallByteMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallCharMethod; // jchar (*CallCharMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallCharMethodV; // jchar (*CallCharMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallCharMethodA; // jchar (*CallCharMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallShortMethod; // jshort (*CallShortMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallShortMethodV; // jshort (*CallShortMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallShortMethodA; // jshort (*CallShortMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallIntMethod; // jint (*CallIntMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallIntMethodV; // jint (*CallIntMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallIntMethodA; // jint (*CallIntMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallLongMethod; // jlong (*CallLongMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallLongMethodV; // jlong (*CallLongMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallLongMethodA; // jlong (*CallLongMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallFloatMethod; // jfloat (*CallFloatMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallFloatMethodV; // jfloat (*CallFloatMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallFloatMethodA; // jfloat (*CallFloatMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallDoubleMethod; // jdouble (*CallDoubleMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallDoubleMethodV; // jdouble (*CallDoubleMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallDoubleMethodA; // jdouble (*CallDoubleMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallVoidMethod; // void (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallVoidMethodV; // void (*CallVoidMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallVoidMethodA; // void (*CallVoidMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallNonvirtualObjectMethod; // jobject (*CallNonvirtualObjectMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualObjectMethodV; // jobject (*CallNonvirtualObjectMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualObjectMethodA; // jobject (*CallNonvirtualObjectMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualBooleanMethod; // jboolean (*CallNonvirtualBooleanMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualBooleanMethodV; // jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualBooleanMethodA; // jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualSByteMethod; // jbyte (*CallNonvirtualByteMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualSByteMethodV; // jbyte (*CallNonvirtualByteMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualSByteMethodA; // jbyte (*CallNonvirtualSByteMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualCharMethod; // jchar (*CallNonvirtualCharMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualCharMethodV; // jchar (*CallNonvirtualCharMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualCharMethodA; // jchar (*CallNonvirtualCharMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualShortMethod; // jshort (*CallNonvirtualShortMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualShortMethodV; // jshort (*CallNonvirtualShortMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualShortMethodA; // jshort (*CallNonvirtualShortMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualIntMethod; // jint (*CallNonvirtualIntMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualIntMethodV; // jint (*CallNonvirtualIntMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualIntMethodA; // jint (*CallNonvirtualIntMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualLongMethod; // jlong (*CallNonvirtualLongMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualLongMethodV; // jlong (*CallNonvirtualLongMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualLongMethodA; // jlong (*CallNonvirtualLongMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualFloatMethod; // jfloat (*CallNonvirtualFloatMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualFloatMethodV; // jfloat (*CallNonvirtualFloatMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualFloatMethodA; // jfloat (*CallNonvirtualFloatMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualDoubleMethod; // jdouble (*CallNonvirtualDoubleMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualDoubleMethodV; // jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualDoubleMethodA; // jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualVoidMethod; // void (*CallNonvirtualVoidMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualVoidMethodV; // void (*CallNonvirtualVoidMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualVoidMethodA; // void (*CallNonvirtualVoidMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr GetFieldID; // jfieldID (*GetFieldID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr GetObjectField; // jobject (*GetObjectField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetBooleanField; // jboolean (*GetBooleanField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetByteField; // jbyte (*GetByteField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetCharField; // jchar (*GetCharField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetShortField; // jshort (*GetShortField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetIntField; // jint (*GetIntField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetLongField; // jlong (*GetLongField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetFloatField; // jfloat (*GetFloatField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetDoubleField; // jdouble (*GetDoubleField)(JNIEnv*, jobject, jfieldID); + public IntPtr SetObjectField; // void (*SetObjectField)(JNIEnv*, jobject, jfieldID, jobject); + public IntPtr SetBooleanField; // void (*SetBooleanField)(JNIEnv*, jobject, jfieldID, jboolean); + public IntPtr SetByteField; // void (*SetByteField)(JNIEnv*, jobject, jfieldID, jbyte); + public IntPtr SetCharField; // void (*SetCharField)(JNIEnv*, jobject, jfieldID, jchar); + public IntPtr SetShortField; // void (*SetShortField)(JNIEnv*, jobject, jfieldID, jshort); + public IntPtr SetIntField; // void (*SetIntField)(JNIEnv*, jobject, jfieldID, jint); + public IntPtr SetLongField; // void (*SetLongField)(JNIEnv*, jobject, jfieldID, jlong); + public IntPtr SetFloatField; // void (*SetFloatField)(JNIEnv*, jobject, jfieldID, jfloat); + public IntPtr SetDoubleField; // void (*SetDoubleField)(JNIEnv*, jobject, jfieldID, jdouble); + public IntPtr GetStaticMethodID; // jmethodID (*GetStaticMethodID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr CallStaticObjectMethod; // jobject (*CallStaticObjectMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticObjectMethodV; // jobject (*CallStaticObjectMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticObjectMethodA; // jobject (*CallStaticObjectMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticBooleanMethod; // jboolean (*CallStaticBooleanMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticBooleanMethodV; // jboolean (*CallStaticBooleanMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticBooleanMethodA; // jboolean (*CallStaticBooleanMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticSByteMethod; // jbyte (*CallStaticByteMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticSByteMethodV; // jbyte (*CallStaticSByteMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticSByteMethodA; // jbyte (*CallStaticByteMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticCharMethod; // jchar (*CallStaticCharMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticCharMethodV; // jchar (*CallStaticCharMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticCharMethodA; // jchar (*CallStaticCharMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticShortMethod; // jshort (*CallStaticShortMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticShortMethodV; // jshort (*CallStaticShortMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticShortMethodA; // jshort (*CallStaticShortMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticIntMethod; // jint (*CallStaticIntMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticIntMethodV; // jint (*CallStaticIntMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticIntMethodA; // jint (*CallStaticIntMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticLongMethod; // jlong (*CallStaticLongMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticLongMethodV; // jlong (*CallStaticLongMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticLongMethodA; // jlong (*CallStaticLongMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticFloatMethod; // jfloat (*CallStaticFloatMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticFloatMethodV; // jfloat (*CallStaticFloatMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticFloatMethodA; // jfloat (*CallStaticFloatMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticDoubleMethod; // jdouble (*CallStaticDoubleMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticDoubleMethodV; // jdouble (*CallStaticDoubleMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticDoubleMethodA; // jdouble (*CallStaticDoubleMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticVoidMethod; // void (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticVoidMethodV; // void (*CallStaticVoidMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticVoidMethodA; // void (*CallStaticVoidMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr GetStaticFieldID; // jstaticfieldID (*GetStaticFieldID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr GetStaticObjectField; // jobject (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticBooleanField; // jboolean (*GetStaticBooleanField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticByteField; // jbyte (*GetStaticByteField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticCharField; // jchar (*GetStaticCharField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticShortField; // jshort (*GetStaticShortField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticIntField; // jint (*GetStaticIntField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticLongField; // jlong (*GetStaticLongField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticFloatField; // jfloat (*GetStaticFloatField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticDoubleField; // jdouble (*GetStaticDoubleField)(JNIEnv*, jclass, jfieldID); + public IntPtr SetStaticObjectField; // void (*SetStaticObjectField)(JNIEnv*, jclass, jfieldID, jobject); + public IntPtr SetStaticBooleanField; // void (*SetStaticBooleanField)(JNIEnv*, jclass, jfieldID, jboolean); + public IntPtr SetStaticByteField; // void (*SetStaticByteField)(JNIEnv*, jclass, jfieldID, jbyte); + public IntPtr SetStaticCharField; // void (*SetStaticCharField)(JNIEnv*, jclass, jfieldID, jchar); + public IntPtr SetStaticShortField; // void (*SetStaticShortField)(JNIEnv*, jclass, jfieldID, jshort); + public IntPtr SetStaticIntField; // void (*SetStaticIntField)(JNIEnv*, jclass, jfieldID, jint); + public IntPtr SetStaticLongField; // void (*SetStaticLongField)(JNIEnv*, jclass, jfieldID, jlong); + public IntPtr SetStaticFloatField; // void (*SetStaticFloatField)(JNIEnv*, jclass, jfieldID, jfloat); + public IntPtr SetStaticDoubleField; // void (*SetStaticDoubleField)(JNIEnv*, jclass, jfieldID, jdouble); + public IntPtr NewString; // jstring (*NewString)(JNIEnv*, const jchar*, jsize); + public IntPtr GetStringLength; // jsize (*GetStringLength)(JNIEnv*, jstring); + public IntPtr GetStringChars; // const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringChars; // void (*ReleaseStringChars)(JNIEnv*, jstring, const jchar*); + public IntPtr NewStringUTF; // jstring (*NewStringUTF)(JNIEnv*, const char*); + public IntPtr GetStringUTFLength; // jsize (*GetStringUTFLength)(JNIEnv*, jstring); + public IntPtr GetStringUTFChars; // const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringUTFChars; // void (*ReleaseStringUTFChars)(JNIEnv*, jstring, const char*); + public IntPtr GetArrayLength; // jsize (*GetArrayLength)(JNIEnv*, jarray); + public IntPtr NewObjectArray; // jobjectArray (*NewObjectArray)(JNIEnv*, jsize, jclass, jobject); + public IntPtr GetObjectArrayElement; // jobject (*GetObjectArrayElement)(JNIEnv*, jobjectArray, jsize); + public IntPtr SetObjectArrayElement; // void (*SetObjectArrayElement)(JNIEnv*, jobjectArray, jsize, jobject); + public IntPtr NewBooleanArray; // jbooleanArray (*NewBooleanArray)(JNIEnv*, jsize); + public IntPtr NewByteArray; // jbyteArray (*NewByteArray)(JNIEnv*, jsize); + public IntPtr NewCharArray; // jcharArray (*NewCharArray)(JNIEnv*, jsize); + public IntPtr NewShortArray; // jshortArray (*NewShortArray)(JNIEnv*, jsize); + public IntPtr NewIntArray; // jintArray (*NewIntArray)(JNIEnv*, jsize); + public IntPtr NewLongArray; // jlongArray (*NewLongArray)(JNIEnv*, jsize); + public IntPtr NewFloatArray; // jfloatArray (*NewFloatArray)(JNIEnv*, jsize); + public IntPtr NewDoubleArray; // jdoubleArray (*NewDoubleArray)(JNIEnv*, jsize); + public IntPtr GetBooleanArrayElements; // jboolean* (*GetBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*); + public IntPtr GetByteArrayElements; // jbyte* (*GetByteArrayElements)(JNIEnv*, jbyteArray, jboolean*); + public IntPtr GetCharArrayElements; // jchar* (*GetCharArrayElements)(JNIEnv*, jcharArray, jboolean*); + public IntPtr GetShortArrayElements; // jshort* (*GetShortArrayElements)(JNIEnv*, jshortArray, jboolean*); + public IntPtr GetIntArrayElements; // jint* (*GetIntArrayElements)(JNIEnv*, jintArray, jboolean*); + public IntPtr GetLongArrayElements; // jlong* (*GetLongArrayElements)(JNIEnv*, jlongArray, jboolean*); + public IntPtr GetFloatArrayElements; // jfloat* (*GetFloatArrayElements)(JNIEnv*, jfloatArray, jboolean*); + public IntPtr GetDoubleArrayElements; // jdouble* (*GetDoubleArrayElements)(JNIEnv*, jdoubleArray, jboolean*); + public IntPtr ReleaseBooleanArrayElements; // void (*ReleaseBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*, jint); + public IntPtr ReleaseByteArrayElements; // void (*ReleaseByteArrayElements)(JNIEnv*, jbyteArray, jbyte*, jint); + public IntPtr ReleaseCharArrayElements; // void (*ReleaseCharArrayElements)(JNIEnv*, jcharArray, jchar*, jint); + public IntPtr ReleaseShortArrayElements; // void (*ReleaseShortArrayElements)(JNIEnv*, jshortArray, jshort*, jint); + public IntPtr ReleaseIntArrayElements; // void (*ReleaseIntArrayElements)(JNIEnv*, jintArray, jint*, jint); + public IntPtr ReleaseLongArrayElements; // void (*ReleaseLongArrayElements)(JNIEnv*, jlongArray, jlong*, jint); + public IntPtr ReleaseFloatArrayElements; // void (*ReleaseFloatArrayElements)(JNIEnv*, jfloatArray, jfloat*, jint); + public IntPtr ReleaseDoubleArrayElements; // void (*ReleaseDoubleArrayElements)(JNIEnv*, jdoubleArray, jdouble*, jint); + public IntPtr GetBooleanArrayRegion; // void (*GetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, jboolean*); + public IntPtr GetByteArrayRegion; // void (*GetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, jbyte*); + public IntPtr GetCharArrayRegion; // void (*GetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, jchar*); + public IntPtr GetShortArrayRegion; // void (*GetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, jshort*); + public IntPtr GetIntArrayRegion; // void (*GetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, jint*); + public IntPtr GetLongArrayRegion; // void (*GetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, jlong*); + public IntPtr GetFloatArrayRegion; // void (*GetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, jfloat*); + public IntPtr GetDoubleArrayRegion; // void (*GetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, jdouble*); + public IntPtr SetBooleanArrayRegion; // void (*SetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, const jboolean*); + public IntPtr SetByteArrayRegion; // void (*SetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, const jbyte*); + public IntPtr SetCharArrayRegion; // void (*SetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, const jchar*); + public IntPtr SetShortArrayRegion; // void (*SetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, const jshort*); + public IntPtr SetIntArrayRegion; // void (*SetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, const jint*); + public IntPtr SetLongArrayRegion; // void (*SetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, const jlong*); + public IntPtr SetFloatArrayRegion; // void (*SetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, const jfloat*); + public IntPtr SetDoubleArrayRegion; // void (*SetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, const jdouble*); + public IntPtr RegisterNatives; // jint (*RegisterNatives)(JNIEnv*, jclass, const JNINativeMethod*, jint); + public IntPtr UnregisterNatives; // jint (*UnregisterNatives)(JNIEnv*, jclass); + public IntPtr MonitorEnter; // jint (*MonitorEnter)(JNIEnv*, jobject); + public IntPtr MonitorExit; // jint (*MonitorExit)(JNIEnv*, jobject); + public IntPtr GetJavaVM; // jint (*GetJavaVM)(JNIEnv*, JavaVM**); + public IntPtr GetStringRegion; // void (*GetStringRegion)(JNIEnv*, jstring, jsize, jsize, jchar*); + public IntPtr GetStringUTFRegion; // void (*GetStringUTFRegion)(JNIEnv*, jstring, jsize, jsize, char*); + public IntPtr GetPrimitiveArrayCritical; // void* (*GetPrimitiveArrayCritical)(JNIEnv*, jarray, jboolean*); + public IntPtr ReleasePrimitiveArrayCritical; // void (*ReleasePrimitiveArrayCritical)(JNIEnv*, jarray, void*, jint); + public IntPtr GetStringCritical; // const jchar* (*GetStringCritical)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringCritical; // void (*ReleaseStringCritical)(JNIEnv*, jstring, const jchar*); + public IntPtr NewWeakGlobalRef; // jweak (*NewWeakGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteWeakGlobalRef; // void (*DeleteWeakGlobalRef)(JNIEnv*, jweak); + public IntPtr ExceptionCheck; // jboolean (*ExceptionCheck)(JNIEnv*); + public IntPtr NewDirectByteBuffer; // jobject (*NewDirectByteBuffer)(JNIEnv*, void*, jlong); + public IntPtr GetDirectBufferAddress; // void* (*GetDirectBufferAddress)(JNIEnv*, jobject); + public IntPtr GetDirectBufferCapacity; // jlong (*GetDirectBufferCapacity)(JNIEnv*, jobject); + public IntPtr GetObjectRefType; // jobjectRefType (*GetObjectRefType)(JNIEnv*, jobject); +#pragma warning restore 0169 +#pragma warning restore 0649 + } +} +#if FEATURE_HANDLES_ARE_SAFE_HANDLES +namespace +#if _NAMESPACE_PER_HANDLE + Java.Interop.SafeHandles +#else + Java.Interop +#endif +{ + + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int (JniEnvironmentSafeHandle env); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference (JniEnvironmentSafeHandle env, string name, JniReferenceSafeHandle loader, IntPtr buf, int bufLen); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference (JniEnvironmentSafeHandle env, string classname); + unsafe delegate JniInstanceMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle method); + unsafe delegate JniInstanceFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle field); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle cls, JniInstanceMethodID jmethod, bool isStatic); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle clazz1, JniReferenceSafeHandle clazz2); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle cls, JniInstanceFieldID jfieldID, bool isStatic); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle obj); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle clazz, string message); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle (JniEnvironmentSafeHandle env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_string (JniEnvironmentSafeHandle env, string msg); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int_int (JniEnvironmentSafeHandle env, int capacity); + unsafe delegate JniGlobalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr (JniEnvironmentSafeHandle env, IntPtr jobject); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniInstanceMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle kls, string name, string signature); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniInstanceFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, JniReferenceSafeHandle val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, double val); + unsafe delegate JniStaticMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate JniStaticFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, JniReferenceSafeHandle val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, double val); + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl, CharSet=CharSet.Unicode)] + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference (JniEnvironmentSafeHandle env, IntPtr unicodeChars, int len); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr chars); + unsafe delegate string JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, string utf); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env, int length, JniReferenceSafeHandle elementClass, JniReferenceSafeHandle initialElement); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int index); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int index, JniReferenceSafeHandle value); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference (JniEnvironmentSafeHandle env, int length); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, IntPtr elems, int mode); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int start, int len, IntPtr buf); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniNativeMethodRegistration [] methods, int nMethods); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int (JniEnvironmentSafeHandle env, out JavaVMSafeHandle vm); + unsafe delegate JniWeakGlobalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_bool (JniEnvironmentSafeHandle env); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference (JniEnvironmentSafeHandle env, IntPtr address, long capacity); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle buf); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle buf); + unsafe delegate JniObjectReferenceType JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + + partial class JniEnvironment { + + internal static partial class Activator { + + public static unsafe JniLocalReference AllocObject (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.AllocObject (JniEnvironment.Current.SafeHandle, jclass); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewObject (JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObject (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewObject (JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + } + + public static partial class Arrays { + + public static unsafe int GetArrayLength (JniReferenceSafeHandle array_ptr) + { + if (array_ptr == null) + throw new ArgumentNullException ("array_ptr"); + if (array_ptr.IsInvalid) + throw new ArgumentException ("array_ptr"); + + var tmp = JniEnvironment.Current.Invoker.GetArrayLength (JniEnvironment.Current.SafeHandle, array_ptr); + return tmp; + } + + public static unsafe JniLocalReference NewObjectArray (int length, JniReferenceSafeHandle elementClass, JniReferenceSafeHandle initialElement) + { + if (elementClass == null) + throw new ArgumentNullException ("elementClass"); + if (elementClass.IsInvalid) + throw new ArgumentException ("elementClass"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectArray (JniEnvironment.Current.SafeHandle, length, elementClass, initialElement); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference GetObjectArrayElement (JniReferenceSafeHandle array, int index) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe void SetObjectArrayElement (JniReferenceSafeHandle array, int index, JniReferenceSafeHandle value) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + JniEnvironment.Current.Invoker.SetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index, value); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniLocalReference NewBooleanArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewBooleanArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewByteArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewByteArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewCharArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewCharArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewShortArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewShortArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewIntArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewIntArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewLongArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewLongArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewFloatArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewFloatArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewDoubleArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewDoubleArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetBooleanArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetByteArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetByteArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetCharArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetCharArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetShortArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetShortArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetIntArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetIntArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetLongArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetLongArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetFloatArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetDoubleArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe void ReleaseBooleanArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseByteArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseByteArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseCharArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseCharArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseShortArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseShortArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseIntArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseIntArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseLongArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseLongArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseFloatArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseFloatArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseDoubleArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + internal static unsafe void GetBooleanArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetByteArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetCharArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetShortArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetIntArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetLongArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetFloatArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetDoubleArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void SetBooleanArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetByteArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetCharArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetShortArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetIntArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetLongArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetFloatArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetDoubleArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + } + + public static partial class Errors { + + public static unsafe int Throw (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.Throw (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int ThrowNew (JniReferenceSafeHandle clazz, string message) + { + if (clazz == null) + throw new ArgumentNullException ("clazz"); + if (clazz.IsInvalid) + throw new ArgumentException ("clazz"); + if (message == null) + throw new ArgumentNullException ("message"); + + var tmp = JniEnvironment.Current.Invoker.ThrowNew (JniEnvironment.Current.SafeHandle, clazz, message); + return tmp; + } + + internal static unsafe JniLocalReference ExceptionOccurred () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionOccurred (JniEnvironment.Current.SafeHandle); + return tmp; + } + + internal static unsafe void ExceptionDescribe () + { + JniEnvironment.Current.Invoker.ExceptionDescribe (JniEnvironment.Current.SafeHandle); + } + + internal static unsafe void ExceptionClear () + { + JniEnvironment.Current.Invoker.ExceptionClear (JniEnvironment.Current.SafeHandle); + } + + public static unsafe void FatalError (string msg) + { + if (msg == null) + throw new ArgumentNullException ("msg"); + + JniEnvironment.Current.Invoker.FatalError (JniEnvironment.Current.SafeHandle, msg); + } + + internal static unsafe bool ExceptionCheck () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionCheck (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + + public static partial class Handles { + + public static unsafe int PushLocalFrame (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.PushLocalFrame (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe JniLocalReference PopLocalFrame (JniReferenceSafeHandle result) + { + var tmp = JniEnvironment.Current.Invoker.PopLocalFrame (JniEnvironment.Current.SafeHandle, result); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniGlobalReference NewGlobalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe void DeleteLocalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteLocalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniLocalReference NewLocalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewLocalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + public static unsafe int EnsureLocalCapacity (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.EnsureLocalCapacity (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe int GetJavaVM (out JavaVMSafeHandle vm) + { + var tmp = JniEnvironment.Current.Invoker.GetJavaVM (JniEnvironment.Current.SafeHandle, out vm); + return tmp; + } + + internal static unsafe JniWeakGlobalReference NewWeakGlobalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteWeakGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniObjectReferenceType GetObjectRefType (JniReferenceSafeHandle jobject) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectRefType (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + } + + public static partial class IO { + + public static unsafe JniLocalReference NewDirectByteBuffer (IntPtr address, long capacity) + { + if (address == IntPtr.Zero) + throw new ArgumentException ("'address' must not be IntPtr.Zero.", "address"); + + var tmp = JniEnvironment.Current.Invoker.NewDirectByteBuffer (JniEnvironment.Current.SafeHandle, address, capacity); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetDirectBufferAddress (JniReferenceSafeHandle buf) + { + if (buf == null) + throw new ArgumentNullException ("buf"); + if (buf.IsInvalid) + throw new ArgumentException ("buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferAddress (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + + public static unsafe long GetDirectBufferCapacity (JniReferenceSafeHandle buf) + { + if (buf == null) + throw new ArgumentNullException ("buf"); + if (buf.IsInvalid) + throw new ArgumentException ("buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferCapacity (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + } + + internal static partial class Members { + + internal static unsafe JniLocalReference ToReflectedMethod (JniReferenceSafeHandle cls, JniInstanceMethodID jmethod, bool isStatic) + { + if (cls == null) + throw new ArgumentNullException ("cls"); + if (cls.IsInvalid) + throw new ArgumentException ("cls"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedMethod (JniEnvironment.Current.SafeHandle, cls, jmethod, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference ToReflectedField (JniReferenceSafeHandle cls, JniInstanceFieldID jfieldID, bool isStatic) + { + if (cls == null) + throw new ArgumentNullException ("cls"); + if (cls.IsInvalid) + throw new ArgumentException ("cls"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedField (JniEnvironment.Current.SafeHandle, cls, jfieldID, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniInstanceMethodID GetMethodID (JniReferenceSafeHandle kls, string name, string signature) + { + if (kls == null) + throw new ArgumentNullException ("kls"); + if (kls.IsInvalid) + throw new ArgumentException ("kls"); + if (name == null) + throw new ArgumentNullException ("name"); + if (signature == null) + throw new ArgumentNullException ("signature"); + + var tmp = JniEnvironment.Current.Invoker.GetMethodID (JniEnvironment.Current.SafeHandle, kls, name, signature); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference CallObjectMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallObjectMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallBooleanMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallBooleanMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallVoidMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallVoidMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallNonvirtualVoidMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallNonvirtualVoidMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniInstanceFieldID GetFieldID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference GetObjectField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetBooleanField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetByteField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe char GetCharField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe short GetShortField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe int GetIntField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe long GetLongField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe float GetFloatField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe double GetDoubleField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, JniReferenceSafeHandle val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, bool val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, sbyte val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, char val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, short val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, int val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, long val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, float val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, double val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + public static unsafe JniStaticMethodID GetStaticMethodID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticMethodID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference CallStaticObjectMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallStaticObjectMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallStaticVoidMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallStaticVoidMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniStaticFieldID GetStaticFieldID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference GetStaticObjectField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetStaticBooleanField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetStaticByteField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe char GetStaticCharField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe short GetStaticShortField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe int GetStaticIntField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe long GetStaticLongField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe float GetStaticFloatField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe double GetStaticDoubleField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, JniReferenceSafeHandle val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, bool val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, sbyte val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, char val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, short val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, int val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, long val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, float val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, double val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + } + + internal static partial class Monitors { + + public static unsafe int MonitorEnter (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorEnter (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int MonitorExit (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorExit (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + } + + public static partial class Strings { + + internal static unsafe JniLocalReference NewString (IntPtr unicodeChars, int len) + { + if (unicodeChars == IntPtr.Zero) + throw new ArgumentException ("'unicodeChars' must not be IntPtr.Zero.", "unicodeChars"); + + var tmp = JniEnvironment.Current.Invoker.NewString (JniEnvironment.Current.SafeHandle, unicodeChars, len); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe int GetStringLength (JniReferenceSafeHandle @string) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringLength (JniEnvironment.Current.SafeHandle, @string); + return tmp; + } + + internal static unsafe IntPtr GetStringChars (JniReferenceSafeHandle @string, IntPtr isCopy) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringChars (JniEnvironment.Current.SafeHandle, @string, isCopy); + return tmp; + } + + internal static unsafe void ReleaseStringChars (JniReferenceSafeHandle @string, IntPtr chars) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + if (chars == IntPtr.Zero) + throw new ArgumentException ("'chars' must not be IntPtr.Zero.", "chars"); + + JniEnvironment.Current.Invoker.ReleaseStringChars (JniEnvironment.Current.SafeHandle, @string, chars); + } + } + + public static partial class Types { + + internal static unsafe JniLocalReference DefineClass (string name, JniReferenceSafeHandle loader, IntPtr buf, int bufLen) + { + if (name == null) + throw new ArgumentNullException ("name"); + if (loader == null) + throw new ArgumentNullException ("loader"); + if (loader.IsInvalid) + throw new ArgumentException ("loader"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.DefineClass (JniEnvironment.Current.SafeHandle, name, loader, buf, bufLen); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference FindClass (string classname) + { + if (classname == null) + throw new ArgumentNullException ("classname"); + + var tmp = JniEnvironment.Current.Invoker.FindClass (JniEnvironment.Current.SafeHandle, classname); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference GetSuperclass (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.GetSuperclass (JniEnvironment.Current.SafeHandle, jclass); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsAssignableFrom (JniReferenceSafeHandle clazz1, JniReferenceSafeHandle clazz2) + { + if (clazz1 == null) + throw new ArgumentNullException ("clazz1"); + if (clazz1.IsInvalid) + throw new ArgumentException ("clazz1"); + if (clazz2 == null) + throw new ArgumentNullException ("clazz2"); + if (clazz2.IsInvalid) + throw new ArgumentException ("clazz2"); + + var tmp = JniEnvironment.Current.Invoker.IsAssignableFrom (JniEnvironment.Current.SafeHandle, clazz1, clazz2); + return tmp; + } + + public static unsafe bool IsSameObject (JniReferenceSafeHandle ref1, JniReferenceSafeHandle ref2) + { + var tmp = JniEnvironment.Current.Invoker.IsSameObject (JniEnvironment.Current.SafeHandle, ref1, ref2); + return tmp; + } + + public static unsafe JniLocalReference GetObjectClass (JniReferenceSafeHandle jobject) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectClass (JniEnvironment.Current.SafeHandle, jobject); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsInstanceOf (JniReferenceSafeHandle obj, JniReferenceSafeHandle clazz) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + if (clazz == null) + throw new ArgumentNullException ("clazz"); + if (clazz.IsInvalid) + throw new ArgumentException ("clazz"); + + var tmp = JniEnvironment.Current.Invoker.IsInstanceOf (JniEnvironment.Current.SafeHandle, obj, clazz); + return tmp; + } + + internal static unsafe int RegisterNatives (JniReferenceSafeHandle jclass, JniNativeMethodRegistration [] methods, int nMethods) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.RegisterNatives (JniEnvironment.Current.SafeHandle, jclass, methods, nMethods); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int UnregisterNatives (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.UnregisterNatives (JniEnvironment.Current.SafeHandle, jclass); + return tmp; + } + } + + internal static partial class Versions { + + internal static unsafe int GetVersion () + { + var tmp = JniEnvironment.Current.Invoker.GetVersion (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + } + + partial class JniEnvironmentInvoker { + + internal JniNativeInterfaceStruct env; + + public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) + { + env = *p; + } + + + JniFunc_JniEnvironmentSafeHandle_int _GetVersion; + public JniFunc_JniEnvironmentSafeHandle_int GetVersion { + get { + if (_GetVersion == null) + _GetVersion = (JniFunc_JniEnvironmentSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JniEnvironmentSafeHandle_int)); + return _GetVersion; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference _DefineClass; + public JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference DefineClass { + get { + if (_DefineClass == null) + _DefineClass = (JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference)); + return _DefineClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference _FindClass; + public JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference FindClass { + get { + if (_FindClass == null) + _FindClass = (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference)); + return _FindClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _FromReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID FromReflectedMethod { + get { + if (_FromReflectedMethod == null) + _FromReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _FromReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID _FromReflectedField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID FromReflectedField { + get { + if (_FromReflectedField == null) + _FromReflectedField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID)); + return _FromReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference _ToReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference ToReflectedMethod { + get { + if (_ToReflectedMethod == null) + _ToReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference)); + return _ToReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _GetSuperclass; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference GetSuperclass { + get { + if (_GetSuperclass == null) + _GetSuperclass = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _GetSuperclass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsAssignableFrom; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsAssignableFrom { + get { + if (_IsAssignableFrom == null) + _IsAssignableFrom = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsAssignableFrom; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference _ToReflectedField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference ToReflectedField { + get { + if (_ToReflectedField == null) + _ToReflectedField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference)); + return _ToReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _Throw; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int Throw { + get { + if (_Throw == null) + _Throw = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _Throw; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int _ThrowNew; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int ThrowNew { + get { + if (_ThrowNew == null) + _ThrowNew = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int)); + return _ThrowNew; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniLocalReference _ExceptionOccurred; + public JniFunc_JniEnvironmentSafeHandle_JniLocalReference ExceptionOccurred { + get { + if (_ExceptionOccurred == null) + _ExceptionOccurred = (JniFunc_JniEnvironmentSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JniEnvironmentSafeHandle_JniLocalReference)); + return _ExceptionOccurred; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionDescribe; + public JniAction_JniEnvironmentSafeHandle ExceptionDescribe { + get { + if (_ExceptionDescribe == null) + _ExceptionDescribe = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionDescribe; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionClear; + public JniAction_JniEnvironmentSafeHandle ExceptionClear { + get { + if (_ExceptionClear == null) + _ExceptionClear = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionClear; + } + } + + JniAction_JniEnvironmentSafeHandle_string _FatalError; + public JniAction_JniEnvironmentSafeHandle_string FatalError { + get { + if (_FatalError == null) + _FatalError = (JniAction_JniEnvironmentSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JniEnvironmentSafeHandle_string)); + return _FatalError; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _PushLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_int_int PushLocalFrame { + get { + if (_PushLocalFrame == null) + _PushLocalFrame = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _PushLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _PopLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference PopLocalFrame { + get { + if (_PopLocalFrame == null) + _PopLocalFrame = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _PopLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference _NewGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference NewGlobalRef { + get { + if (_NewGlobalRef == null) + _NewGlobalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference)); + return _NewGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteGlobalRef { + get { + if (_DeleteGlobalRef == null) + _DeleteGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteLocalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteLocalRef { + get { + if (_DeleteLocalRef == null) + _DeleteLocalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsSameObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsSameObject { + get { + if (_IsSameObject == null) + _IsSameObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsSameObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _NewLocalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference NewLocalRef { + get { + if (_NewLocalRef == null) + _NewLocalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _NewLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _EnsureLocalCapacity; + public JniFunc_JniEnvironmentSafeHandle_int_int EnsureLocalCapacity { + get { + if (_EnsureLocalCapacity == null) + _EnsureLocalCapacity = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _EnsureLocalCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _AllocObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference AllocObject { + get { + if (_AllocObject == null) + _AllocObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _AllocObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _NewObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference NewObject { + get { + if (_NewObject == null) + _NewObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _NewObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _NewObjectA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference NewObjectA { + get { + if (_NewObjectA == null) + _NewObjectA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _NewObjectA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _GetObjectClass; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference GetObjectClass { + get { + if (_GetObjectClass == null) + _GetObjectClass = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _GetObjectClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsInstanceOf; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsInstanceOf { + get { + if (_IsInstanceOf == null) + _IsInstanceOf = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsInstanceOf; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID _GetMethodID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID GetMethodID { + get { + if (_GetMethodID == null) + _GetMethodID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID)); + return _GetMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _CallObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference CallObjectMethod { + get { + if (_CallObjectMethod == null) + _CallObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _CallObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _CallObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference CallObjectMethodA { + get { + if (_CallObjectMethodA == null) + _CallObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _CallObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool _CallBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool CallBooleanMethod { + get { + if (_CallBooleanMethod == null) + _CallBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool)); + return _CallBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool _CallBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool CallBooleanMethodA { + get { + if (_CallBooleanMethodA == null) + _CallBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool)); + return _CallBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte _CallSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte CallSByteMethod { + get { + if (_CallSByteMethod == null) + _CallSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte)); + return _CallSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte _CallSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte CallSByteMethodA { + get { + if (_CallSByteMethodA == null) + _CallSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte)); + return _CallSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char _CallCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char CallCharMethod { + get { + if (_CallCharMethod == null) + _CallCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char)); + return _CallCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char _CallCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char CallCharMethodA { + get { + if (_CallCharMethodA == null) + _CallCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char)); + return _CallCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short _CallShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short CallShortMethod { + get { + if (_CallShortMethod == null) + _CallShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short)); + return _CallShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short _CallShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short CallShortMethodA { + get { + if (_CallShortMethodA == null) + _CallShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short)); + return _CallShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int _CallIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int CallIntMethod { + get { + if (_CallIntMethod == null) + _CallIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int)); + return _CallIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int _CallIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int CallIntMethodA { + get { + if (_CallIntMethodA == null) + _CallIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int)); + return _CallIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long _CallLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long CallLongMethod { + get { + if (_CallLongMethod == null) + _CallLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long)); + return _CallLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long _CallLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long CallLongMethodA { + get { + if (_CallLongMethodA == null) + _CallLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long)); + return _CallLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float _CallFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float CallFloatMethod { + get { + if (_CallFloatMethod == null) + _CallFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float)); + return _CallFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float _CallFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float CallFloatMethodA { + get { + if (_CallFloatMethodA == null) + _CallFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float)); + return _CallFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double _CallDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double CallDoubleMethod { + get { + if (_CallDoubleMethod == null) + _CallDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double)); + return _CallDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double _CallDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double CallDoubleMethodA { + get { + if (_CallDoubleMethodA == null) + _CallDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double)); + return _CallDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _CallVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID CallVoidMethod { + get { + if (_CallVoidMethod == null) + _CallVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _CallVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef _CallVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef CallVoidMethodA { + get { + if (_CallVoidMethodA == null) + _CallVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef)); + return _CallVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _CallNonvirtualObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference CallNonvirtualObjectMethod { + get { + if (_CallNonvirtualObjectMethod == null) + _CallNonvirtualObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _CallNonvirtualObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _CallNonvirtualObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference CallNonvirtualObjectMethodA { + get { + if (_CallNonvirtualObjectMethodA == null) + _CallNonvirtualObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _CallNonvirtualObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool _CallNonvirtualBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool CallNonvirtualBooleanMethod { + get { + if (_CallNonvirtualBooleanMethod == null) + _CallNonvirtualBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool)); + return _CallNonvirtualBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool _CallNonvirtualBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool CallNonvirtualBooleanMethodA { + get { + if (_CallNonvirtualBooleanMethodA == null) + _CallNonvirtualBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool)); + return _CallNonvirtualBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte _CallNonvirtualSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte CallNonvirtualSByteMethod { + get { + if (_CallNonvirtualSByteMethod == null) + _CallNonvirtualSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte)); + return _CallNonvirtualSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte _CallNonvirtualSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte CallNonvirtualSByteMethodA { + get { + if (_CallNonvirtualSByteMethodA == null) + _CallNonvirtualSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte)); + return _CallNonvirtualSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char _CallNonvirtualCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char CallNonvirtualCharMethod { + get { + if (_CallNonvirtualCharMethod == null) + _CallNonvirtualCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char)); + return _CallNonvirtualCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char _CallNonvirtualCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char CallNonvirtualCharMethodA { + get { + if (_CallNonvirtualCharMethodA == null) + _CallNonvirtualCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char)); + return _CallNonvirtualCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short _CallNonvirtualShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short CallNonvirtualShortMethod { + get { + if (_CallNonvirtualShortMethod == null) + _CallNonvirtualShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short)); + return _CallNonvirtualShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short _CallNonvirtualShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short CallNonvirtualShortMethodA { + get { + if (_CallNonvirtualShortMethodA == null) + _CallNonvirtualShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short)); + return _CallNonvirtualShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int _CallNonvirtualIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int CallNonvirtualIntMethod { + get { + if (_CallNonvirtualIntMethod == null) + _CallNonvirtualIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int)); + return _CallNonvirtualIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int _CallNonvirtualIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int CallNonvirtualIntMethodA { + get { + if (_CallNonvirtualIntMethodA == null) + _CallNonvirtualIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int)); + return _CallNonvirtualIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long _CallNonvirtualLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long CallNonvirtualLongMethod { + get { + if (_CallNonvirtualLongMethod == null) + _CallNonvirtualLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long)); + return _CallNonvirtualLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long _CallNonvirtualLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long CallNonvirtualLongMethodA { + get { + if (_CallNonvirtualLongMethodA == null) + _CallNonvirtualLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long)); + return _CallNonvirtualLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float _CallNonvirtualFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float CallNonvirtualFloatMethod { + get { + if (_CallNonvirtualFloatMethod == null) + _CallNonvirtualFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float)); + return _CallNonvirtualFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float _CallNonvirtualFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float CallNonvirtualFloatMethodA { + get { + if (_CallNonvirtualFloatMethodA == null) + _CallNonvirtualFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float)); + return _CallNonvirtualFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double _CallNonvirtualDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double CallNonvirtualDoubleMethod { + get { + if (_CallNonvirtualDoubleMethod == null) + _CallNonvirtualDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double)); + return _CallNonvirtualDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double _CallNonvirtualDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double CallNonvirtualDoubleMethodA { + get { + if (_CallNonvirtualDoubleMethodA == null) + _CallNonvirtualDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double)); + return _CallNonvirtualDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _CallNonvirtualVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID CallNonvirtualVoidMethod { + get { + if (_CallNonvirtualVoidMethod == null) + _CallNonvirtualVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _CallNonvirtualVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef _CallNonvirtualVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef CallNonvirtualVoidMethodA { + get { + if (_CallNonvirtualVoidMethodA == null) + _CallNonvirtualVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef)); + return _CallNonvirtualVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID _GetFieldID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID GetFieldID { + get { + if (_GetFieldID == null) + _GetFieldID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID)); + return _GetFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference _GetObjectField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference GetObjectField { + get { + if (_GetObjectField == null) + _GetObjectField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference)); + return _GetObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool _GetBooleanField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool GetBooleanField { + get { + if (_GetBooleanField == null) + _GetBooleanField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool)); + return _GetBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte _GetByteField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte GetByteField { + get { + if (_GetByteField == null) + _GetByteField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte)); + return _GetByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char _GetCharField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char GetCharField { + get { + if (_GetCharField == null) + _GetCharField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char)); + return _GetCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short _GetShortField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short GetShortField { + get { + if (_GetShortField == null) + _GetShortField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short)); + return _GetShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int _GetIntField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int GetIntField { + get { + if (_GetIntField == null) + _GetIntField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int)); + return _GetIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long _GetLongField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long GetLongField { + get { + if (_GetLongField == null) + _GetLongField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long)); + return _GetLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float _GetFloatField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float GetFloatField { + get { + if (_GetFloatField == null) + _GetFloatField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float)); + return _GetFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double _GetDoubleField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double GetDoubleField { + get { + if (_GetDoubleField == null) + _GetDoubleField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double)); + return _GetDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle _SetObjectField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle SetObjectField { + get { + if (_SetObjectField == null) + _SetObjectField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle)); + return _SetObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool _SetBooleanField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool SetBooleanField { + get { + if (_SetBooleanField == null) + _SetBooleanField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool)); + return _SetBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte _SetByteField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte SetByteField { + get { + if (_SetByteField == null) + _SetByteField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte)); + return _SetByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char _SetCharField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char SetCharField { + get { + if (_SetCharField == null) + _SetCharField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char)); + return _SetCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short _SetShortField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short SetShortField { + get { + if (_SetShortField == null) + _SetShortField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short)); + return _SetShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int _SetIntField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int SetIntField { + get { + if (_SetIntField == null) + _SetIntField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int)); + return _SetIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long _SetLongField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long SetLongField { + get { + if (_SetLongField == null) + _SetLongField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long)); + return _SetLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float _SetFloatField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float SetFloatField { + get { + if (_SetFloatField == null) + _SetFloatField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float)); + return _SetFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double _SetDoubleField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double SetDoubleField { + get { + if (_SetDoubleField == null) + _SetDoubleField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double)); + return _SetDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID _GetStaticMethodID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID GetStaticMethodID { + get { + if (_GetStaticMethodID == null) + _GetStaticMethodID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID)); + return _GetStaticMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference _CallStaticObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference CallStaticObjectMethod { + get { + if (_CallStaticObjectMethod == null) + _CallStaticObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference)); + return _CallStaticObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference _CallStaticObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference CallStaticObjectMethodA { + get { + if (_CallStaticObjectMethodA == null) + _CallStaticObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference)); + return _CallStaticObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool _CallStaticBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool CallStaticBooleanMethod { + get { + if (_CallStaticBooleanMethod == null) + _CallStaticBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool)); + return _CallStaticBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool _CallStaticBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool CallStaticBooleanMethodA { + get { + if (_CallStaticBooleanMethodA == null) + _CallStaticBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool)); + return _CallStaticBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte _CallStaticSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte CallStaticSByteMethod { + get { + if (_CallStaticSByteMethod == null) + _CallStaticSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte)); + return _CallStaticSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte _CallStaticSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte CallStaticSByteMethodA { + get { + if (_CallStaticSByteMethodA == null) + _CallStaticSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte)); + return _CallStaticSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char _CallStaticCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char CallStaticCharMethod { + get { + if (_CallStaticCharMethod == null) + _CallStaticCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char)); + return _CallStaticCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char _CallStaticCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char CallStaticCharMethodA { + get { + if (_CallStaticCharMethodA == null) + _CallStaticCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char)); + return _CallStaticCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short _CallStaticShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short CallStaticShortMethod { + get { + if (_CallStaticShortMethod == null) + _CallStaticShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short)); + return _CallStaticShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short _CallStaticShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short CallStaticShortMethodA { + get { + if (_CallStaticShortMethodA == null) + _CallStaticShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short)); + return _CallStaticShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int _CallStaticIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int CallStaticIntMethod { + get { + if (_CallStaticIntMethod == null) + _CallStaticIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int)); + return _CallStaticIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int _CallStaticIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int CallStaticIntMethodA { + get { + if (_CallStaticIntMethodA == null) + _CallStaticIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int)); + return _CallStaticIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long _CallStaticLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long CallStaticLongMethod { + get { + if (_CallStaticLongMethod == null) + _CallStaticLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long)); + return _CallStaticLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long _CallStaticLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long CallStaticLongMethodA { + get { + if (_CallStaticLongMethodA == null) + _CallStaticLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long)); + return _CallStaticLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float _CallStaticFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float CallStaticFloatMethod { + get { + if (_CallStaticFloatMethod == null) + _CallStaticFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float)); + return _CallStaticFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float _CallStaticFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float CallStaticFloatMethodA { + get { + if (_CallStaticFloatMethodA == null) + _CallStaticFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float)); + return _CallStaticFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double _CallStaticDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double CallStaticDoubleMethod { + get { + if (_CallStaticDoubleMethod == null) + _CallStaticDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double)); + return _CallStaticDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double _CallStaticDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double CallStaticDoubleMethodA { + get { + if (_CallStaticDoubleMethodA == null) + _CallStaticDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double)); + return _CallStaticDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID _CallStaticVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID CallStaticVoidMethod { + get { + if (_CallStaticVoidMethod == null) + _CallStaticVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID)); + return _CallStaticVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef _CallStaticVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef CallStaticVoidMethodA { + get { + if (_CallStaticVoidMethodA == null) + _CallStaticVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef)); + return _CallStaticVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID _GetStaticFieldID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID GetStaticFieldID { + get { + if (_GetStaticFieldID == null) + _GetStaticFieldID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID)); + return _GetStaticFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference _GetStaticObjectField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference GetStaticObjectField { + get { + if (_GetStaticObjectField == null) + _GetStaticObjectField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference)); + return _GetStaticObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool _GetStaticBooleanField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool GetStaticBooleanField { + get { + if (_GetStaticBooleanField == null) + _GetStaticBooleanField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool)); + return _GetStaticBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte _GetStaticByteField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte GetStaticByteField { + get { + if (_GetStaticByteField == null) + _GetStaticByteField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte)); + return _GetStaticByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char _GetStaticCharField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char GetStaticCharField { + get { + if (_GetStaticCharField == null) + _GetStaticCharField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char)); + return _GetStaticCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short _GetStaticShortField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short GetStaticShortField { + get { + if (_GetStaticShortField == null) + _GetStaticShortField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short)); + return _GetStaticShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int _GetStaticIntField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int GetStaticIntField { + get { + if (_GetStaticIntField == null) + _GetStaticIntField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int)); + return _GetStaticIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long _GetStaticLongField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long GetStaticLongField { + get { + if (_GetStaticLongField == null) + _GetStaticLongField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long)); + return _GetStaticLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float _GetStaticFloatField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float GetStaticFloatField { + get { + if (_GetStaticFloatField == null) + _GetStaticFloatField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float)); + return _GetStaticFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double _GetStaticDoubleField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double GetStaticDoubleField { + get { + if (_GetStaticDoubleField == null) + _GetStaticDoubleField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double)); + return _GetStaticDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle _SetStaticObjectField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle SetStaticObjectField { + get { + if (_SetStaticObjectField == null) + _SetStaticObjectField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle)); + return _SetStaticObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool _SetStaticBooleanField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool SetStaticBooleanField { + get { + if (_SetStaticBooleanField == null) + _SetStaticBooleanField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool)); + return _SetStaticBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte _SetStaticByteField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte SetStaticByteField { + get { + if (_SetStaticByteField == null) + _SetStaticByteField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte)); + return _SetStaticByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char _SetStaticCharField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char SetStaticCharField { + get { + if (_SetStaticCharField == null) + _SetStaticCharField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char)); + return _SetStaticCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short _SetStaticShortField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short SetStaticShortField { + get { + if (_SetStaticShortField == null) + _SetStaticShortField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short)); + return _SetStaticShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int _SetStaticIntField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int SetStaticIntField { + get { + if (_SetStaticIntField == null) + _SetStaticIntField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int)); + return _SetStaticIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long _SetStaticLongField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long SetStaticLongField { + get { + if (_SetStaticLongField == null) + _SetStaticLongField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long)); + return _SetStaticLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float _SetStaticFloatField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float SetStaticFloatField { + get { + if (_SetStaticFloatField == null) + _SetStaticFloatField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float)); + return _SetStaticFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double _SetStaticDoubleField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double SetStaticDoubleField { + get { + if (_SetStaticDoubleField == null) + _SetStaticDoubleField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double)); + return _SetStaticDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference _NewString; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference NewString { + get { + if (_NewString == null) + _NewString = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference)); + return _NewString; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetStringLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetStringLength { + get { + if (_GetStringLength == null) + _GetStringLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetStringLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetStringChars; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetStringChars { + get { + if (_GetStringChars == null) + _GetStringChars = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetStringChars; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr _ReleaseStringChars; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr ReleaseStringChars { + get { + if (_ReleaseStringChars == null) + _ReleaseStringChars = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr)); + return _ReleaseStringChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference _NewStringUTF; + public JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference NewStringUTF { + get { + if (_NewStringUTF == null) + _NewStringUTF = (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference)); + return _NewStringUTF; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetStringUTFLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetStringUTFLength { + get { + if (_GetStringUTFLength == null) + _GetStringUTFLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetStringUTFLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string _GetStringUTFChars; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string GetStringUTFChars { + get { + if (_GetStringUTFChars == null) + _GetStringUTFChars = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string)); + return _GetStringUTFChars; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string _ReleaseStringUTFChars; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string ReleaseStringUTFChars { + get { + if (_ReleaseStringUTFChars == null) + _ReleaseStringUTFChars = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string)); + return _ReleaseStringUTFChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetArrayLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetArrayLength { + get { + if (_GetArrayLength == null) + _GetArrayLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetArrayLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference _NewObjectArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference NewObjectArray { + get { + if (_NewObjectArray == null) + _NewObjectArray = (JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _NewObjectArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference _GetObjectArrayElement; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference GetObjectArrayElement { + get { + if (_GetObjectArrayElement == null) + _GetObjectArrayElement = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference)); + return _GetObjectArrayElement; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle _SetObjectArrayElement; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle SetObjectArrayElement { + get { + if (_SetObjectArrayElement == null) + _SetObjectArrayElement = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle)); + return _SetObjectArrayElement; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewBooleanArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewBooleanArray { + get { + if (_NewBooleanArray == null) + _NewBooleanArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewBooleanArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewByteArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewByteArray { + get { + if (_NewByteArray == null) + _NewByteArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewByteArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewCharArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewCharArray { + get { + if (_NewCharArray == null) + _NewCharArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewCharArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewShortArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewShortArray { + get { + if (_NewShortArray == null) + _NewShortArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewShortArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewIntArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewIntArray { + get { + if (_NewIntArray == null) + _NewIntArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewIntArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewLongArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewLongArray { + get { + if (_NewLongArray == null) + _NewLongArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewLongArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewFloatArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewFloatArray { + get { + if (_NewFloatArray == null) + _NewFloatArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewFloatArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewDoubleArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewDoubleArray { + get { + if (_NewDoubleArray == null) + _NewDoubleArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewDoubleArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetBooleanArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetBooleanArrayElements { + get { + if (_GetBooleanArrayElements == null) + _GetBooleanArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetBooleanArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetByteArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetByteArrayElements { + get { + if (_GetByteArrayElements == null) + _GetByteArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetByteArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetCharArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetCharArrayElements { + get { + if (_GetCharArrayElements == null) + _GetCharArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetCharArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetShortArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetShortArrayElements { + get { + if (_GetShortArrayElements == null) + _GetShortArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetShortArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetIntArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetIntArrayElements { + get { + if (_GetIntArrayElements == null) + _GetIntArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetIntArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetLongArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetLongArrayElements { + get { + if (_GetLongArrayElements == null) + _GetLongArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetLongArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetFloatArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetFloatArrayElements { + get { + if (_GetFloatArrayElements == null) + _GetFloatArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetFloatArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetDoubleArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetDoubleArrayElements { + get { + if (_GetDoubleArrayElements == null) + _GetDoubleArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseBooleanArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseBooleanArrayElements { + get { + if (_ReleaseBooleanArrayElements == null) + _ReleaseBooleanArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseBooleanArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseByteArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseByteArrayElements { + get { + if (_ReleaseByteArrayElements == null) + _ReleaseByteArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseByteArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseCharArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseCharArrayElements { + get { + if (_ReleaseCharArrayElements == null) + _ReleaseCharArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseCharArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseShortArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseShortArrayElements { + get { + if (_ReleaseShortArrayElements == null) + _ReleaseShortArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseShortArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseIntArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseIntArrayElements { + get { + if (_ReleaseIntArrayElements == null) + _ReleaseIntArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseIntArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseLongArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseLongArrayElements { + get { + if (_ReleaseLongArrayElements == null) + _ReleaseLongArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseLongArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseFloatArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseFloatArrayElements { + get { + if (_ReleaseFloatArrayElements == null) + _ReleaseFloatArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseFloatArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseDoubleArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseDoubleArrayElements { + get { + if (_ReleaseDoubleArrayElements == null) + _ReleaseDoubleArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetBooleanArrayRegion { + get { + if (_GetBooleanArrayRegion == null) + _GetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetByteArrayRegion { + get { + if (_GetByteArrayRegion == null) + _GetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetCharArrayRegion { + get { + if (_GetCharArrayRegion == null) + _GetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetShortArrayRegion { + get { + if (_GetShortArrayRegion == null) + _GetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetIntArrayRegion { + get { + if (_GetIntArrayRegion == null) + _GetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetLongArrayRegion { + get { + if (_GetLongArrayRegion == null) + _GetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetFloatArrayRegion { + get { + if (_GetFloatArrayRegion == null) + _GetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetDoubleArrayRegion { + get { + if (_GetDoubleArrayRegion == null) + _GetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetDoubleArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetBooleanArrayRegion { + get { + if (_SetBooleanArrayRegion == null) + _SetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetByteArrayRegion { + get { + if (_SetByteArrayRegion == null) + _SetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetCharArrayRegion { + get { + if (_SetCharArrayRegion == null) + _SetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetShortArrayRegion { + get { + if (_SetShortArrayRegion == null) + _SetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetIntArrayRegion { + get { + if (_SetIntArrayRegion == null) + _SetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetLongArrayRegion { + get { + if (_SetLongArrayRegion == null) + _SetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetFloatArrayRegion { + get { + if (_SetFloatArrayRegion == null) + _SetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetDoubleArrayRegion { + get { + if (_SetDoubleArrayRegion == null) + _SetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetDoubleArrayRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int _RegisterNatives; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int RegisterNatives { + get { + if (_RegisterNatives == null) + _RegisterNatives = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int)); + return _RegisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _UnregisterNatives; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int UnregisterNatives { + get { + if (_UnregisterNatives == null) + _UnregisterNatives = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _UnregisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _MonitorEnter; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int MonitorEnter { + get { + if (_MonitorEnter == null) + _MonitorEnter = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _MonitorEnter; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _MonitorExit; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int MonitorExit { + get { + if (_MonitorExit == null) + _MonitorExit = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _MonitorExit; + } + } + + JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int _GetJavaVM; + public JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int GetJavaVM { + get { + if (_GetJavaVM == null) + _GetJavaVM = (JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int)); + return _GetJavaVM; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetStringRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetStringRegion { + get { + if (_GetStringRegion == null) + _GetStringRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetStringRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetStringUTFRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetStringUTFRegion { + get { + if (_GetStringUTFRegion == null) + _GetStringUTFRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetStringUTFRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetPrimitiveArrayCritical; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetPrimitiveArrayCritical { + get { + if (_GetPrimitiveArrayCritical == null) + _GetPrimitiveArrayCritical = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetPrimitiveArrayCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleasePrimitiveArrayCritical; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleasePrimitiveArrayCritical { + get { + if (_ReleasePrimitiveArrayCritical == null) + _ReleasePrimitiveArrayCritical = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleasePrimitiveArrayCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string _GetStringCritical; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string GetStringCritical { + get { + if (_GetStringCritical == null) + _GetStringCritical = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string)); + return _GetStringCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string _ReleaseStringCritical; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string ReleaseStringCritical { + get { + if (_ReleaseStringCritical == null) + _ReleaseStringCritical = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string)); + return _ReleaseStringCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference _NewWeakGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference NewWeakGlobalRef { + get { + if (_NewWeakGlobalRef == null) + _NewWeakGlobalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference)); + return _NewWeakGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteWeakGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteWeakGlobalRef { + get { + if (_DeleteWeakGlobalRef == null) + _DeleteWeakGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteWeakGlobalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_bool _ExceptionCheck; + public JniFunc_JniEnvironmentSafeHandle_bool ExceptionCheck { + get { + if (_ExceptionCheck == null) + _ExceptionCheck = (JniFunc_JniEnvironmentSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JniEnvironmentSafeHandle_bool)); + return _ExceptionCheck; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference _NewDirectByteBuffer; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference NewDirectByteBuffer { + get { + if (_NewDirectByteBuffer == null) + _NewDirectByteBuffer = (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference)); + return _NewDirectByteBuffer; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr _GetDirectBufferAddress; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr GetDirectBufferAddress { + get { + if (_GetDirectBufferAddress == null) + _GetDirectBufferAddress = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr)); + return _GetDirectBufferAddress; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long _GetDirectBufferCapacity; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long GetDirectBufferCapacity { + get { + if (_GetDirectBufferCapacity == null) + _GetDirectBufferCapacity = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long)); + return _GetDirectBufferCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType _GetObjectRefType; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType GetObjectRefType { + get { + if (_GetObjectRefType == null) + _GetObjectRefType = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType)); + return _GetObjectRefType; + } + } + } +} +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES +#if FEATURE_HANDLES_ARE_INTPTRS +namespace +#if _NAMESPACE_PER_HANDLE + Java.Interop.IntPtrs +#else + Java.Interop +#endif +{ + + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int (JNIEnvPtr env); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_string_IntPtr_IntPtr_int_jobject (JNIEnvPtr env, string name, IntPtr loader, IntPtr buf, int bufLen); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_string_jobject (JNIEnvPtr env, string classname); + unsafe delegate jinstanceMethodID JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID (JNIEnvPtr env, IntPtr method); + unsafe delegate jinstanceFieldID JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID (JNIEnvPtr env, IntPtr field); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool_jobject (JNIEnvPtr env, IntPtr cls, jinstanceMethodID jmethod, bool isStatic); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject (JNIEnvPtr env, IntPtr jclass); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool (JNIEnvPtr env, IntPtr clazz1, IntPtr clazz2); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool_jobject (JNIEnvPtr env, IntPtr cls, jinstanceFieldID jfieldID, bool isStatic); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_int (JNIEnvPtr env, IntPtr obj); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_string_int (JNIEnvPtr env, IntPtr clazz, string message); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject (JNIEnvPtr env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle (JNIEnvPtr env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_string (JNIEnvPtr env, string msg); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int_int (JNIEnvPtr env, int capacity); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr (JNIEnvPtr env, IntPtr jobject); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject (JNIEnvPtr env, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject (JNIEnvPtr env, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jinstanceMethodID JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceMethodID (JNIEnvPtr env, IntPtr kls, string name, string signature); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_bool (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_sbyte (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_sbyte (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_char (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_char (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_short (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_short (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_int (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_int (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_long (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_long (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_float (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_float (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_double (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_double (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef (JNIEnvPtr env, IntPtr jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_jobject (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_jobject (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_bool (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_bool (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_sbyte (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_sbyte (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_char (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_char (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_short (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_short (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_int (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_int (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_long (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_long (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_float (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_float (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_double (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_double (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef (JNIEnvPtr env, IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jinstanceFieldID JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceFieldID (JNIEnvPtr env, IntPtr jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_jobject (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_IntPtr (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, IntPtr val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double (JNIEnvPtr env, IntPtr jobject, jinstanceFieldID jfieldID, double val); + unsafe delegate jstaticMethodID JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticMethodID (JNIEnvPtr env, IntPtr jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_jobject (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_jobject (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_bool (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_bool (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_sbyte (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_sbyte (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_char (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_char (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_short (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_short (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_int (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_int (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_long (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_long (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_float (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_float (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_double (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_double (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef (JNIEnvPtr env, IntPtr jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate jstaticFieldID JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticFieldID (JNIEnvPtr env, IntPtr jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_jobject (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_IntPtr (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, IntPtr val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double (JNIEnvPtr env, IntPtr jclass, jstaticFieldID jfieldID, double val); + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl, CharSet=CharSet.Unicode)] + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject (JNIEnvPtr env, IntPtr unicodeChars, int len); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr (JNIEnvPtr env, IntPtr @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr (JNIEnvPtr env, IntPtr @string, IntPtr chars); + unsafe delegate string JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string (JNIEnvPtr env, IntPtr @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_string (JNIEnvPtr env, IntPtr @string, string utf); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_int_IntPtr_IntPtr_jobject (JNIEnvPtr env, int length, IntPtr elementClass, IntPtr initialElement); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_int_IntPtr (JNIEnvPtr env, IntPtr array, int index, IntPtr value); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_int_jobject (JNIEnvPtr env, int length); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int (JNIEnvPtr env, IntPtr array, IntPtr elems, int mode); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr (JNIEnvPtr env, IntPtr array, int start, int len, IntPtr buf); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_IntPtr_JniNativeMethodRegistrationArray_int_int (JNIEnvPtr env, IntPtr jclass, JniNativeMethodRegistration [] methods, int nMethods); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_outIntPtr_int (JNIEnvPtr env, out IntPtr vm); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_bool (JNIEnvPtr env); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject (JNIEnvPtr env, IntPtr address, long capacity); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr (JNIEnvPtr env, IntPtr buf); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_IntPtr_long (JNIEnvPtr env, IntPtr buf); + unsafe delegate JniObjectReferenceType JniFunc_JniEnvironmentSafeHandle_IntPtr_JniObjectReferenceType (JNIEnvPtr env, IntPtr jobject); + + partial class JniEnvironment { + + internal static partial class Activator { + + public static unsafe IntPtr AllocObject (IntPtr jclass) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.AllocObject (JniEnvironment.Current.SafeHandle, jclass); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewObject (IntPtr jclass, jinstanceMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObject (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewObject (IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + } + + public static partial class Arrays { + + public static unsafe int GetArrayLength (IntPtr array_ptr) + { + if (array_ptr == IntPtr.Zero) + throw new ArgumentException ("`array_ptr` must not be IntPtr.Zero.", "array_ptr"); + + var tmp = JniEnvironment.Current.Invoker.GetArrayLength (JniEnvironment.Current.SafeHandle, array_ptr); + return tmp; + } + + public static unsafe IntPtr NewObjectArray (int length, IntPtr elementClass, IntPtr initialElement) + { + if (elementClass == IntPtr.Zero) + throw new ArgumentException ("`elementClass` must not be IntPtr.Zero.", "elementClass"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectArray (JniEnvironment.Current.SafeHandle, length, elementClass, initialElement); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetObjectArrayElement (IntPtr array, int index) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe void SetObjectArrayElement (IntPtr array, int index, IntPtr value) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + JniEnvironment.Current.Invoker.SetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index, value); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe IntPtr NewBooleanArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewBooleanArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewByteArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewByteArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewCharArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewCharArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewShortArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewShortArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewIntArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewIntArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewLongArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewLongArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewFloatArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewFloatArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr NewDoubleArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewDoubleArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetBooleanArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetByteArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetByteArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetCharArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetCharArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetShortArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetShortArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetIntArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetIntArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetLongArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetLongArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetFloatArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetDoubleArrayElements (IntPtr array, IntPtr isCopy) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe void ReleaseBooleanArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseByteArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseByteArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseCharArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseCharArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseShortArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseShortArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseIntArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseIntArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseLongArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseLongArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseFloatArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseFloatArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseDoubleArrayElements (IntPtr array, IntPtr elems, int mode) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + internal static unsafe void GetBooleanArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetByteArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetCharArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetShortArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetIntArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetLongArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetFloatArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetDoubleArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void SetBooleanArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetByteArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetCharArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetShortArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetIntArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetLongArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetFloatArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetDoubleArrayRegion (IntPtr array, int start, int len, IntPtr buf) + { + if (array == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + } + + public static partial class Errors { + + public static unsafe int Throw (IntPtr obj) + { + if (obj == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.Throw (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int ThrowNew (IntPtr clazz, string message) + { + if (clazz == IntPtr.Zero) + throw new ArgumentException ("`clazz` must not be IntPtr.Zero.", "clazz"); + if (message == null) + throw new ArgumentNullException ("message"); + + var tmp = JniEnvironment.Current.Invoker.ThrowNew (JniEnvironment.Current.SafeHandle, clazz, message); + return tmp; + } + + internal static unsafe IntPtr ExceptionOccurred () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionOccurred (JniEnvironment.Current.SafeHandle); + return tmp; + } + + internal static unsafe void ExceptionDescribe () + { + JniEnvironment.Current.Invoker.ExceptionDescribe (JniEnvironment.Current.SafeHandle); + } + + internal static unsafe void ExceptionClear () + { + JniEnvironment.Current.Invoker.ExceptionClear (JniEnvironment.Current.SafeHandle); + } + + public static unsafe void FatalError (string msg) + { + if (msg == null) + throw new ArgumentNullException ("msg"); + + JniEnvironment.Current.Invoker.FatalError (JniEnvironment.Current.SafeHandle, msg); + } + + internal static unsafe bool ExceptionCheck () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionCheck (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + + public static partial class Handles { + + public static unsafe int PushLocalFrame (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.PushLocalFrame (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe IntPtr PopLocalFrame (IntPtr result) + { + var tmp = JniEnvironment.Current.Invoker.PopLocalFrame (JniEnvironment.Current.SafeHandle, result); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe IntPtr NewGlobalRef (IntPtr jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe void DeleteLocalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteLocalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe IntPtr NewLocalRef (IntPtr jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewLocalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + public static unsafe int EnsureLocalCapacity (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.EnsureLocalCapacity (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe int GetJavaVM (out IntPtr vm) + { + var tmp = JniEnvironment.Current.Invoker.GetJavaVM (JniEnvironment.Current.SafeHandle, out vm); + return tmp; + } + + internal static unsafe IntPtr NewWeakGlobalRef (IntPtr jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteWeakGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniObjectReferenceType GetObjectRefType (IntPtr jobject) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectRefType (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + } + + public static partial class IO { + + public static unsafe IntPtr NewDirectByteBuffer (IntPtr address, long capacity) + { + if (address == IntPtr.Zero) + throw new ArgumentException ("'address' must not be IntPtr.Zero.", "address"); + + var tmp = JniEnvironment.Current.Invoker.NewDirectByteBuffer (JniEnvironment.Current.SafeHandle, address, capacity); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetDirectBufferAddress (IntPtr buf) + { + if (buf == IntPtr.Zero) + throw new ArgumentException ("`buf` must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferAddress (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + + public static unsafe long GetDirectBufferCapacity (IntPtr buf) + { + if (buf == IntPtr.Zero) + throw new ArgumentException ("`buf` must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferCapacity (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + } + + internal static partial class Members { + + internal static unsafe IntPtr ToReflectedMethod (IntPtr cls, jinstanceMethodID jmethod, bool isStatic) + { + if (cls == IntPtr.Zero) + throw new ArgumentException ("`cls` must not be IntPtr.Zero.", "cls"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedMethod (JniEnvironment.Current.SafeHandle, cls, jmethod, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe IntPtr ToReflectedField (IntPtr cls, jinstanceFieldID jfieldID, bool isStatic) + { + if (cls == IntPtr.Zero) + throw new ArgumentException ("`cls` must not be IntPtr.Zero.", "cls"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedField (JniEnvironment.Current.SafeHandle, cls, jfieldID, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe jinstanceMethodID GetMethodID (IntPtr kls, string name, string signature) + { + if (kls == IntPtr.Zero) + throw new ArgumentException ("`kls` must not be IntPtr.Zero.", "kls"); + if (name == null) + throw new ArgumentNullException ("name"); + if (signature == null) + throw new ArgumentNullException ("signature"); + + var tmp = JniEnvironment.Current.Invoker.GetMethodID (JniEnvironment.Current.SafeHandle, kls, name, signature); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe IntPtr CallObjectMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe IntPtr CallObjectMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallBooleanMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallBooleanMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallVoidMethod (IntPtr jobject, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallVoidMethod (IntPtr jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe IntPtr CallNonvirtualObjectMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe IntPtr CallNonvirtualObjectMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe jinstanceFieldID GetFieldID (IntPtr jclass, string name, string sig) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe IntPtr GetObjectField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetBooleanField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetByteField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe char GetCharField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe short GetShortField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe int GetIntField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe long GetLongField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe float GetFloatField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe double GetDoubleField (IntPtr jobject, jinstanceFieldID jfieldID) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, IntPtr val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, bool val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, sbyte val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, char val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, short val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, int val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, long val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, float val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (IntPtr jobject, jinstanceFieldID jfieldID, double val) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + public static unsafe jstaticMethodID GetStaticMethodID (IntPtr jclass, string name, string sig) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticMethodID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe IntPtr CallStaticObjectMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe IntPtr CallStaticObjectMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallStaticVoidMethod (IntPtr jclass, jstaticMethodID jmethod) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallStaticVoidMethod (IntPtr jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe jstaticFieldID GetStaticFieldID (IntPtr jclass, string name, string sig) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe IntPtr GetStaticObjectField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetStaticBooleanField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetStaticByteField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe char GetStaticCharField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe short GetStaticShortField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe int GetStaticIntField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe long GetStaticLongField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe float GetStaticFloatField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe double GetStaticDoubleField (IntPtr jclass, jstaticFieldID jfieldID) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, IntPtr val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, bool val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, sbyte val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, char val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, short val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, int val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, long val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, float val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (IntPtr jclass, jstaticFieldID jfieldID, double val) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + } + + internal static partial class Monitors { + + public static unsafe int MonitorEnter (IntPtr obj) + { + if (obj == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorEnter (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int MonitorExit (IntPtr obj) + { + if (obj == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorExit (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + } + + public static partial class Strings { + + internal static unsafe IntPtr NewString (IntPtr unicodeChars, int len) + { + if (unicodeChars == IntPtr.Zero) + throw new ArgumentException ("'unicodeChars' must not be IntPtr.Zero.", "unicodeChars"); + + var tmp = JniEnvironment.Current.Invoker.NewString (JniEnvironment.Current.SafeHandle, unicodeChars, len); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe int GetStringLength (IntPtr @string) + { + if (@string == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringLength (JniEnvironment.Current.SafeHandle, @string); + return tmp; + } + + internal static unsafe IntPtr GetStringChars (IntPtr @string, IntPtr isCopy) + { + if (@string == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringChars (JniEnvironment.Current.SafeHandle, @string, isCopy); + return tmp; + } + + internal static unsafe void ReleaseStringChars (IntPtr @string, IntPtr chars) + { + if (@string == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + if (chars == IntPtr.Zero) + throw new ArgumentException ("'chars' must not be IntPtr.Zero.", "chars"); + + JniEnvironment.Current.Invoker.ReleaseStringChars (JniEnvironment.Current.SafeHandle, @string, chars); + } + } + + public static partial class Types { + + internal static unsafe IntPtr DefineClass (string name, IntPtr loader, IntPtr buf, int bufLen) + { + if (name == null) + throw new ArgumentNullException ("name"); + if (loader == IntPtr.Zero) + throw new ArgumentException ("`loader` must not be IntPtr.Zero.", "loader"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.DefineClass (JniEnvironment.Current.SafeHandle, name, loader, buf, bufLen); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr FindClass (string classname) + { + if (classname == null) + throw new ArgumentNullException ("classname"); + + var tmp = JniEnvironment.Current.Invoker.FindClass (JniEnvironment.Current.SafeHandle, classname); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetSuperclass (IntPtr jclass) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.GetSuperclass (JniEnvironment.Current.SafeHandle, jclass); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsAssignableFrom (IntPtr clazz1, IntPtr clazz2) + { + if (clazz1 == IntPtr.Zero) + throw new ArgumentException ("`clazz1` must not be IntPtr.Zero.", "clazz1"); + if (clazz2 == IntPtr.Zero) + throw new ArgumentException ("`clazz2` must not be IntPtr.Zero.", "clazz2"); + + var tmp = JniEnvironment.Current.Invoker.IsAssignableFrom (JniEnvironment.Current.SafeHandle, clazz1, clazz2); + return tmp; + } + + public static unsafe bool IsSameObject (IntPtr ref1, IntPtr ref2) + { + var tmp = JniEnvironment.Current.Invoker.IsSameObject (JniEnvironment.Current.SafeHandle, ref1, ref2); + return tmp; + } + + public static unsafe IntPtr GetObjectClass (IntPtr jobject) + { + if (jobject == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectClass (JniEnvironment.Current.SafeHandle, jobject); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsInstanceOf (IntPtr obj, IntPtr clazz) + { + if (obj == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + if (clazz == IntPtr.Zero) + throw new ArgumentException ("`clazz` must not be IntPtr.Zero.", "clazz"); + + var tmp = JniEnvironment.Current.Invoker.IsInstanceOf (JniEnvironment.Current.SafeHandle, obj, clazz); + return tmp; + } + + internal static unsafe int RegisterNatives (IntPtr jclass, JniNativeMethodRegistration [] methods, int nMethods) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.RegisterNatives (JniEnvironment.Current.SafeHandle, jclass, methods, nMethods); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int UnregisterNatives (IntPtr jclass) + { + if (jclass == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.UnregisterNatives (JniEnvironment.Current.SafeHandle, jclass); + return tmp; + } + } + + internal static partial class Versions { + + internal static unsafe int GetVersion () + { + var tmp = JniEnvironment.Current.Invoker.GetVersion (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + } + + partial class JniEnvironmentInvoker { + + internal JniNativeInterfaceStruct env; + + public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) + { + env = *p; + } + + + JniFunc_JniEnvironmentSafeHandle_int _GetVersion; + public JniFunc_JniEnvironmentSafeHandle_int GetVersion { + get { + if (_GetVersion == null) + _GetVersion = (JniFunc_JniEnvironmentSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JniEnvironmentSafeHandle_int)); + return _GetVersion; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_IntPtr_IntPtr_int_jobject _DefineClass; + public JniFunc_JniEnvironmentSafeHandle_string_IntPtr_IntPtr_int_jobject DefineClass { + get { + if (_DefineClass == null) + _DefineClass = (JniFunc_JniEnvironmentSafeHandle_string_IntPtr_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_IntPtr_IntPtr_int_jobject)); + return _DefineClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_jobject _FindClass; + public JniFunc_JniEnvironmentSafeHandle_string_jobject FindClass { + get { + if (_FindClass == null) + _FindClass = (JniFunc_JniEnvironmentSafeHandle_string_jobject) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_jobject)); + return _FindClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID _FromReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID FromReflectedMethod { + get { + if (_FromReflectedMethod == null) + _FromReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID)); + return _FromReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID _FromReflectedField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID FromReflectedField { + get { + if (_FromReflectedField == null) + _FromReflectedField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID)); + return _FromReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool_jobject _ToReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool_jobject ToReflectedMethod { + get { + if (_ToReflectedMethod == null) + _ToReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool_jobject)); + return _ToReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _GetSuperclass; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject GetSuperclass { + get { + if (_GetSuperclass == null) + _GetSuperclass = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _GetSuperclass; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool _IsAssignableFrom; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool IsAssignableFrom { + get { + if (_IsAssignableFrom == null) + _IsAssignableFrom = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool)); + return _IsAssignableFrom; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool_jobject _ToReflectedField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool_jobject ToReflectedField { + get { + if (_ToReflectedField == null) + _ToReflectedField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool_jobject)); + return _ToReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _Throw; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int Throw { + get { + if (_Throw == null) + _Throw = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _Throw; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_string_int _ThrowNew; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_string_int ThrowNew { + get { + if (_ThrowNew == null) + _ThrowNew = (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_int)); + return _ThrowNew; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject _ExceptionOccurred; + public JniFunc_JniEnvironmentSafeHandle_jobject ExceptionOccurred { + get { + if (_ExceptionOccurred == null) + _ExceptionOccurred = (JniFunc_JniEnvironmentSafeHandle_jobject) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JniEnvironmentSafeHandle_jobject)); + return _ExceptionOccurred; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionDescribe; + public JniAction_JniEnvironmentSafeHandle ExceptionDescribe { + get { + if (_ExceptionDescribe == null) + _ExceptionDescribe = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionDescribe; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionClear; + public JniAction_JniEnvironmentSafeHandle ExceptionClear { + get { + if (_ExceptionClear == null) + _ExceptionClear = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionClear; + } + } + + JniAction_JniEnvironmentSafeHandle_string _FatalError; + public JniAction_JniEnvironmentSafeHandle_string FatalError { + get { + if (_FatalError == null) + _FatalError = (JniAction_JniEnvironmentSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JniEnvironmentSafeHandle_string)); + return _FatalError; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _PushLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_int_int PushLocalFrame { + get { + if (_PushLocalFrame == null) + _PushLocalFrame = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _PushLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _PopLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject PopLocalFrame { + get { + if (_PopLocalFrame == null) + _PopLocalFrame = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _PopLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _NewGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject NewGlobalRef { + get { + if (_NewGlobalRef == null) + _NewGlobalRef = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _NewGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteGlobalRef { + get { + if (_DeleteGlobalRef == null) + _DeleteGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteLocalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteLocalRef { + get { + if (_DeleteLocalRef == null) + _DeleteLocalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool _IsSameObject; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool IsSameObject { + get { + if (_IsSameObject == null) + _IsSameObject = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool)); + return _IsSameObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _NewLocalRef; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject NewLocalRef { + get { + if (_NewLocalRef == null) + _NewLocalRef = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _NewLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _EnsureLocalCapacity; + public JniFunc_JniEnvironmentSafeHandle_int_int EnsureLocalCapacity { + get { + if (_EnsureLocalCapacity == null) + _EnsureLocalCapacity = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _EnsureLocalCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _AllocObject; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject AllocObject { + get { + if (_AllocObject == null) + _AllocObject = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _AllocObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject _NewObject; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject NewObject { + get { + if (_NewObject == null) + _NewObject = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject)); + return _NewObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject _NewObjectA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject NewObjectA { + get { + if (_NewObjectA == null) + _NewObjectA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject)); + return _NewObjectA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _GetObjectClass; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject GetObjectClass { + get { + if (_GetObjectClass == null) + _GetObjectClass = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _GetObjectClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool _IsInstanceOf; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool IsInstanceOf { + get { + if (_IsInstanceOf == null) + _IsInstanceOf = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_bool)); + return _IsInstanceOf; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceMethodID _GetMethodID; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceMethodID GetMethodID { + get { + if (_GetMethodID == null) + _GetMethodID = (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceMethodID)); + return _GetMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject _CallObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject CallObjectMethod { + get { + if (_CallObjectMethod == null) + _CallObjectMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_jobject)); + return _CallObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject _CallObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject CallObjectMethodA { + get { + if (_CallObjectMethodA == null) + _CallObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_jobject)); + return _CallObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool _CallBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool CallBooleanMethod { + get { + if (_CallBooleanMethod == null) + _CallBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_bool)); + return _CallBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_bool _CallBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_bool CallBooleanMethodA { + get { + if (_CallBooleanMethodA == null) + _CallBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_bool)); + return _CallBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_sbyte _CallSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_sbyte CallSByteMethod { + get { + if (_CallSByteMethod == null) + _CallSByteMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_sbyte)); + return _CallSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_sbyte _CallSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_sbyte CallSByteMethodA { + get { + if (_CallSByteMethodA == null) + _CallSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_sbyte)); + return _CallSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_char _CallCharMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_char CallCharMethod { + get { + if (_CallCharMethod == null) + _CallCharMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_char)); + return _CallCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_char _CallCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_char CallCharMethodA { + get { + if (_CallCharMethodA == null) + _CallCharMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_char)); + return _CallCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_short _CallShortMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_short CallShortMethod { + get { + if (_CallShortMethod == null) + _CallShortMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_short)); + return _CallShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_short _CallShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_short CallShortMethodA { + get { + if (_CallShortMethodA == null) + _CallShortMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_short)); + return _CallShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_int _CallIntMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_int CallIntMethod { + get { + if (_CallIntMethod == null) + _CallIntMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_int)); + return _CallIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_int _CallIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_int CallIntMethodA { + get { + if (_CallIntMethodA == null) + _CallIntMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_int)); + return _CallIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_long _CallLongMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_long CallLongMethod { + get { + if (_CallLongMethod == null) + _CallLongMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_long)); + return _CallLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_long _CallLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_long CallLongMethodA { + get { + if (_CallLongMethodA == null) + _CallLongMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_long)); + return _CallLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_float _CallFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_float CallFloatMethod { + get { + if (_CallFloatMethod == null) + _CallFloatMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_float)); + return _CallFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_float _CallFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_float CallFloatMethodA { + get { + if (_CallFloatMethodA == null) + _CallFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_float)); + return _CallFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_double _CallDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_double CallDoubleMethod { + get { + if (_CallDoubleMethod == null) + _CallDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_double)); + return _CallDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_double _CallDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_double CallDoubleMethodA { + get { + if (_CallDoubleMethodA == null) + _CallDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef_double)); + return _CallDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID _CallVoidMethod; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID CallVoidMethod { + get { + if (_CallVoidMethod == null) + _CallVoidMethod = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID)); + return _CallVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef _CallVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef CallVoidMethodA { + get { + if (_CallVoidMethodA == null) + _CallVoidMethodA = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceMethodID_JValueRef)); + return _CallVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_jobject _CallNonvirtualObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_jobject CallNonvirtualObjectMethod { + get { + if (_CallNonvirtualObjectMethod == null) + _CallNonvirtualObjectMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_jobject)); + return _CallNonvirtualObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_jobject _CallNonvirtualObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_jobject CallNonvirtualObjectMethodA { + get { + if (_CallNonvirtualObjectMethodA == null) + _CallNonvirtualObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_jobject)); + return _CallNonvirtualObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_bool _CallNonvirtualBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_bool CallNonvirtualBooleanMethod { + get { + if (_CallNonvirtualBooleanMethod == null) + _CallNonvirtualBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_bool)); + return _CallNonvirtualBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_bool _CallNonvirtualBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_bool CallNonvirtualBooleanMethodA { + get { + if (_CallNonvirtualBooleanMethodA == null) + _CallNonvirtualBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_bool)); + return _CallNonvirtualBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_sbyte _CallNonvirtualSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_sbyte CallNonvirtualSByteMethod { + get { + if (_CallNonvirtualSByteMethod == null) + _CallNonvirtualSByteMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_sbyte)); + return _CallNonvirtualSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_sbyte _CallNonvirtualSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_sbyte CallNonvirtualSByteMethodA { + get { + if (_CallNonvirtualSByteMethodA == null) + _CallNonvirtualSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_sbyte)); + return _CallNonvirtualSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_char _CallNonvirtualCharMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_char CallNonvirtualCharMethod { + get { + if (_CallNonvirtualCharMethod == null) + _CallNonvirtualCharMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_char)); + return _CallNonvirtualCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_char _CallNonvirtualCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_char CallNonvirtualCharMethodA { + get { + if (_CallNonvirtualCharMethodA == null) + _CallNonvirtualCharMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_char)); + return _CallNonvirtualCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_short _CallNonvirtualShortMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_short CallNonvirtualShortMethod { + get { + if (_CallNonvirtualShortMethod == null) + _CallNonvirtualShortMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_short)); + return _CallNonvirtualShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_short _CallNonvirtualShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_short CallNonvirtualShortMethodA { + get { + if (_CallNonvirtualShortMethodA == null) + _CallNonvirtualShortMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_short)); + return _CallNonvirtualShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_int _CallNonvirtualIntMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_int CallNonvirtualIntMethod { + get { + if (_CallNonvirtualIntMethod == null) + _CallNonvirtualIntMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_int)); + return _CallNonvirtualIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_int _CallNonvirtualIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_int CallNonvirtualIntMethodA { + get { + if (_CallNonvirtualIntMethodA == null) + _CallNonvirtualIntMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_int)); + return _CallNonvirtualIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_long _CallNonvirtualLongMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_long CallNonvirtualLongMethod { + get { + if (_CallNonvirtualLongMethod == null) + _CallNonvirtualLongMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_long)); + return _CallNonvirtualLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_long _CallNonvirtualLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_long CallNonvirtualLongMethodA { + get { + if (_CallNonvirtualLongMethodA == null) + _CallNonvirtualLongMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_long)); + return _CallNonvirtualLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_float _CallNonvirtualFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_float CallNonvirtualFloatMethod { + get { + if (_CallNonvirtualFloatMethod == null) + _CallNonvirtualFloatMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_float)); + return _CallNonvirtualFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_float _CallNonvirtualFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_float CallNonvirtualFloatMethodA { + get { + if (_CallNonvirtualFloatMethodA == null) + _CallNonvirtualFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_float)); + return _CallNonvirtualFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_double _CallNonvirtualDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_double CallNonvirtualDoubleMethod { + get { + if (_CallNonvirtualDoubleMethod == null) + _CallNonvirtualDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_double)); + return _CallNonvirtualDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_double _CallNonvirtualDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_double CallNonvirtualDoubleMethodA { + get { + if (_CallNonvirtualDoubleMethodA == null) + _CallNonvirtualDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef_double)); + return _CallNonvirtualDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID _CallNonvirtualVoidMethod; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID CallNonvirtualVoidMethod { + get { + if (_CallNonvirtualVoidMethod == null) + _CallNonvirtualVoidMethod = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID)); + return _CallNonvirtualVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef _CallNonvirtualVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef CallNonvirtualVoidMethodA { + get { + if (_CallNonvirtualVoidMethodA == null) + _CallNonvirtualVoidMethodA = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_jinstanceMethodID_JValueRef)); + return _CallNonvirtualVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceFieldID _GetFieldID; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceFieldID GetFieldID { + get { + if (_GetFieldID == null) + _GetFieldID = (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jinstanceFieldID)); + return _GetFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_jobject _GetObjectField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_jobject GetObjectField { + get { + if (_GetObjectField == null) + _GetObjectField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_jobject)); + return _GetObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool _GetBooleanField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool GetBooleanField { + get { + if (_GetBooleanField == null) + _GetBooleanField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool)); + return _GetBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte _GetByteField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte GetByteField { + get { + if (_GetByteField == null) + _GetByteField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte)); + return _GetByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char _GetCharField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char GetCharField { + get { + if (_GetCharField == null) + _GetCharField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char)); + return _GetCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short _GetShortField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short GetShortField { + get { + if (_GetShortField == null) + _GetShortField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short)); + return _GetShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int _GetIntField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int GetIntField { + get { + if (_GetIntField == null) + _GetIntField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int)); + return _GetIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long _GetLongField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long GetLongField { + get { + if (_GetLongField == null) + _GetLongField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long)); + return _GetLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float _GetFloatField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float GetFloatField { + get { + if (_GetFloatField == null) + _GetFloatField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float)); + return _GetFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double _GetDoubleField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double GetDoubleField { + get { + if (_GetDoubleField == null) + _GetDoubleField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double)); + return _GetDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_IntPtr _SetObjectField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_IntPtr SetObjectField { + get { + if (_SetObjectField == null) + _SetObjectField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_IntPtr)); + return _SetObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool _SetBooleanField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool SetBooleanField { + get { + if (_SetBooleanField == null) + _SetBooleanField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_bool)); + return _SetBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte _SetByteField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte SetByteField { + get { + if (_SetByteField == null) + _SetByteField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_sbyte)); + return _SetByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char _SetCharField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char SetCharField { + get { + if (_SetCharField == null) + _SetCharField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_char)); + return _SetCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short _SetShortField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short SetShortField { + get { + if (_SetShortField == null) + _SetShortField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_short)); + return _SetShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int _SetIntField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int SetIntField { + get { + if (_SetIntField == null) + _SetIntField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_int)); + return _SetIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long _SetLongField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long SetLongField { + get { + if (_SetLongField == null) + _SetLongField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_long)); + return _SetLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float _SetFloatField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float SetFloatField { + get { + if (_SetFloatField == null) + _SetFloatField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_float)); + return _SetFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double _SetDoubleField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double SetDoubleField { + get { + if (_SetDoubleField == null) + _SetDoubleField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jinstanceFieldID_double)); + return _SetDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticMethodID _GetStaticMethodID; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticMethodID GetStaticMethodID { + get { + if (_GetStaticMethodID == null) + _GetStaticMethodID = (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticMethodID) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticMethodID)); + return _GetStaticMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_jobject _CallStaticObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_jobject CallStaticObjectMethod { + get { + if (_CallStaticObjectMethod == null) + _CallStaticObjectMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_jobject)); + return _CallStaticObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_jobject _CallStaticObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_jobject CallStaticObjectMethodA { + get { + if (_CallStaticObjectMethodA == null) + _CallStaticObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_jobject)); + return _CallStaticObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_bool _CallStaticBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_bool CallStaticBooleanMethod { + get { + if (_CallStaticBooleanMethod == null) + _CallStaticBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_bool)); + return _CallStaticBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_bool _CallStaticBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_bool CallStaticBooleanMethodA { + get { + if (_CallStaticBooleanMethodA == null) + _CallStaticBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_bool)); + return _CallStaticBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_sbyte _CallStaticSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_sbyte CallStaticSByteMethod { + get { + if (_CallStaticSByteMethod == null) + _CallStaticSByteMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_sbyte)); + return _CallStaticSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_sbyte _CallStaticSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_sbyte CallStaticSByteMethodA { + get { + if (_CallStaticSByteMethodA == null) + _CallStaticSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_sbyte)); + return _CallStaticSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_char _CallStaticCharMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_char CallStaticCharMethod { + get { + if (_CallStaticCharMethod == null) + _CallStaticCharMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_char)); + return _CallStaticCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_char _CallStaticCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_char CallStaticCharMethodA { + get { + if (_CallStaticCharMethodA == null) + _CallStaticCharMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_char)); + return _CallStaticCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_short _CallStaticShortMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_short CallStaticShortMethod { + get { + if (_CallStaticShortMethod == null) + _CallStaticShortMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_short)); + return _CallStaticShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_short _CallStaticShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_short CallStaticShortMethodA { + get { + if (_CallStaticShortMethodA == null) + _CallStaticShortMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_short)); + return _CallStaticShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_int _CallStaticIntMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_int CallStaticIntMethod { + get { + if (_CallStaticIntMethod == null) + _CallStaticIntMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_int)); + return _CallStaticIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_int _CallStaticIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_int CallStaticIntMethodA { + get { + if (_CallStaticIntMethodA == null) + _CallStaticIntMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_int)); + return _CallStaticIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_long _CallStaticLongMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_long CallStaticLongMethod { + get { + if (_CallStaticLongMethod == null) + _CallStaticLongMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_long)); + return _CallStaticLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_long _CallStaticLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_long CallStaticLongMethodA { + get { + if (_CallStaticLongMethodA == null) + _CallStaticLongMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_long)); + return _CallStaticLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_float _CallStaticFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_float CallStaticFloatMethod { + get { + if (_CallStaticFloatMethod == null) + _CallStaticFloatMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_float)); + return _CallStaticFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_float _CallStaticFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_float CallStaticFloatMethodA { + get { + if (_CallStaticFloatMethodA == null) + _CallStaticFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_float)); + return _CallStaticFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_double _CallStaticDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_double CallStaticDoubleMethod { + get { + if (_CallStaticDoubleMethod == null) + _CallStaticDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_double)); + return _CallStaticDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_double _CallStaticDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_double CallStaticDoubleMethodA { + get { + if (_CallStaticDoubleMethodA == null) + _CallStaticDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef_double)); + return _CallStaticDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID _CallStaticVoidMethod; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID CallStaticVoidMethod { + get { + if (_CallStaticVoidMethod == null) + _CallStaticVoidMethod = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID)); + return _CallStaticVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef _CallStaticVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef CallStaticVoidMethodA { + get { + if (_CallStaticVoidMethodA == null) + _CallStaticVoidMethodA = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticMethodID_JValueRef)); + return _CallStaticVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticFieldID _GetStaticFieldID; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticFieldID GetStaticFieldID { + get { + if (_GetStaticFieldID == null) + _GetStaticFieldID = (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticFieldID) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_string_string_jstaticFieldID)); + return _GetStaticFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_jobject _GetStaticObjectField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_jobject GetStaticObjectField { + get { + if (_GetStaticObjectField == null) + _GetStaticObjectField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_jobject)); + return _GetStaticObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool _GetStaticBooleanField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool GetStaticBooleanField { + get { + if (_GetStaticBooleanField == null) + _GetStaticBooleanField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool)); + return _GetStaticBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte _GetStaticByteField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte GetStaticByteField { + get { + if (_GetStaticByteField == null) + _GetStaticByteField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte)); + return _GetStaticByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char _GetStaticCharField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char GetStaticCharField { + get { + if (_GetStaticCharField == null) + _GetStaticCharField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char)); + return _GetStaticCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short _GetStaticShortField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short GetStaticShortField { + get { + if (_GetStaticShortField == null) + _GetStaticShortField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short)); + return _GetStaticShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int _GetStaticIntField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int GetStaticIntField { + get { + if (_GetStaticIntField == null) + _GetStaticIntField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int)); + return _GetStaticIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long _GetStaticLongField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long GetStaticLongField { + get { + if (_GetStaticLongField == null) + _GetStaticLongField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long)); + return _GetStaticLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float _GetStaticFloatField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float GetStaticFloatField { + get { + if (_GetStaticFloatField == null) + _GetStaticFloatField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float)); + return _GetStaticFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double _GetStaticDoubleField; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double GetStaticDoubleField { + get { + if (_GetStaticDoubleField == null) + _GetStaticDoubleField = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double)); + return _GetStaticDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_IntPtr _SetStaticObjectField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_IntPtr SetStaticObjectField { + get { + if (_SetStaticObjectField == null) + _SetStaticObjectField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_IntPtr)); + return _SetStaticObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool _SetStaticBooleanField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool SetStaticBooleanField { + get { + if (_SetStaticBooleanField == null) + _SetStaticBooleanField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_bool)); + return _SetStaticBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte _SetStaticByteField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte SetStaticByteField { + get { + if (_SetStaticByteField == null) + _SetStaticByteField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_sbyte)); + return _SetStaticByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char _SetStaticCharField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char SetStaticCharField { + get { + if (_SetStaticCharField == null) + _SetStaticCharField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_char)); + return _SetStaticCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short _SetStaticShortField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short SetStaticShortField { + get { + if (_SetStaticShortField == null) + _SetStaticShortField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_short)); + return _SetStaticShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int _SetStaticIntField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int SetStaticIntField { + get { + if (_SetStaticIntField == null) + _SetStaticIntField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_int)); + return _SetStaticIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long _SetStaticLongField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long SetStaticLongField { + get { + if (_SetStaticLongField == null) + _SetStaticLongField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_long)); + return _SetStaticLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float _SetStaticFloatField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float SetStaticFloatField { + get { + if (_SetStaticFloatField == null) + _SetStaticFloatField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_float)); + return _SetStaticFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double _SetStaticDoubleField; + public JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double SetStaticDoubleField { + get { + if (_SetStaticDoubleField == null) + _SetStaticDoubleField = (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_jstaticFieldID_double)); + return _SetStaticDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject _NewString; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject NewString { + get { + if (_NewString == null) + _NewString = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject)); + return _NewString; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _GetStringLength; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int GetStringLength { + get { + if (_GetStringLength == null) + _GetStringLength = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _GetStringLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetStringChars; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetStringChars { + get { + if (_GetStringChars == null) + _GetStringChars = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetStringChars; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr _ReleaseStringChars; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr ReleaseStringChars { + get { + if (_ReleaseStringChars == null) + _ReleaseStringChars = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr)); + return _ReleaseStringChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_jobject _NewStringUTF; + public JniFunc_JniEnvironmentSafeHandle_string_jobject NewStringUTF { + get { + if (_NewStringUTF == null) + _NewStringUTF = (JniFunc_JniEnvironmentSafeHandle_string_jobject) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JniEnvironmentSafeHandle_string_jobject)); + return _NewStringUTF; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _GetStringUTFLength; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int GetStringUTFLength { + get { + if (_GetStringUTFLength == null) + _GetStringUTFLength = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _GetStringUTFLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string _GetStringUTFChars; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string GetStringUTFChars { + get { + if (_GetStringUTFChars == null) + _GetStringUTFChars = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string)); + return _GetStringUTFChars; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_string _ReleaseStringUTFChars; + public JniAction_JniEnvironmentSafeHandle_IntPtr_string ReleaseStringUTFChars { + get { + if (_ReleaseStringUTFChars == null) + _ReleaseStringUTFChars = (JniAction_JniEnvironmentSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_string)); + return _ReleaseStringUTFChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _GetArrayLength; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int GetArrayLength { + get { + if (_GetArrayLength == null) + _GetArrayLength = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _GetArrayLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_IntPtr_IntPtr_jobject _NewObjectArray; + public JniFunc_JniEnvironmentSafeHandle_int_IntPtr_IntPtr_jobject NewObjectArray { + get { + if (_NewObjectArray == null) + _NewObjectArray = (JniFunc_JniEnvironmentSafeHandle_int_IntPtr_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_IntPtr_IntPtr_jobject)); + return _NewObjectArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject _GetObjectArrayElement; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject GetObjectArrayElement { + get { + if (_GetObjectArrayElement == null) + _GetObjectArrayElement = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject)); + return _GetObjectArrayElement; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_IntPtr _SetObjectArrayElement; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_IntPtr SetObjectArrayElement { + get { + if (_SetObjectArrayElement == null) + _SetObjectArrayElement = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_IntPtr)); + return _SetObjectArrayElement; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewBooleanArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewBooleanArray { + get { + if (_NewBooleanArray == null) + _NewBooleanArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewBooleanArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewByteArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewByteArray { + get { + if (_NewByteArray == null) + _NewByteArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewByteArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewCharArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewCharArray { + get { + if (_NewCharArray == null) + _NewCharArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewCharArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewShortArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewShortArray { + get { + if (_NewShortArray == null) + _NewShortArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewShortArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewIntArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewIntArray { + get { + if (_NewIntArray == null) + _NewIntArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewIntArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewLongArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewLongArray { + get { + if (_NewLongArray == null) + _NewLongArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewLongArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewFloatArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewFloatArray { + get { + if (_NewFloatArray == null) + _NewFloatArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewFloatArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewDoubleArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewDoubleArray { + get { + if (_NewDoubleArray == null) + _NewDoubleArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewDoubleArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetBooleanArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetBooleanArrayElements { + get { + if (_GetBooleanArrayElements == null) + _GetBooleanArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetBooleanArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetByteArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetByteArrayElements { + get { + if (_GetByteArrayElements == null) + _GetByteArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetByteArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetCharArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetCharArrayElements { + get { + if (_GetCharArrayElements == null) + _GetCharArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetCharArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetShortArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetShortArrayElements { + get { + if (_GetShortArrayElements == null) + _GetShortArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetShortArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetIntArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetIntArrayElements { + get { + if (_GetIntArrayElements == null) + _GetIntArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetIntArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetLongArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetLongArrayElements { + get { + if (_GetLongArrayElements == null) + _GetLongArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetLongArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetFloatArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetFloatArrayElements { + get { + if (_GetFloatArrayElements == null) + _GetFloatArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetFloatArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetDoubleArrayElements; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetDoubleArrayElements { + get { + if (_GetDoubleArrayElements == null) + _GetDoubleArrayElements = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseBooleanArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseBooleanArrayElements { + get { + if (_ReleaseBooleanArrayElements == null) + _ReleaseBooleanArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseBooleanArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseByteArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseByteArrayElements { + get { + if (_ReleaseByteArrayElements == null) + _ReleaseByteArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseByteArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseCharArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseCharArrayElements { + get { + if (_ReleaseCharArrayElements == null) + _ReleaseCharArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseCharArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseShortArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseShortArrayElements { + get { + if (_ReleaseShortArrayElements == null) + _ReleaseShortArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseShortArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseIntArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseIntArrayElements { + get { + if (_ReleaseIntArrayElements == null) + _ReleaseIntArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseIntArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseLongArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseLongArrayElements { + get { + if (_ReleaseLongArrayElements == null) + _ReleaseLongArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseLongArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseFloatArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseFloatArrayElements { + get { + if (_ReleaseFloatArrayElements == null) + _ReleaseFloatArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseFloatArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleaseDoubleArrayElements; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleaseDoubleArrayElements { + get { + if (_ReleaseDoubleArrayElements == null) + _ReleaseDoubleArrayElements = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleaseDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetBooleanArrayRegion { + get { + if (_GetBooleanArrayRegion == null) + _GetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetByteArrayRegion { + get { + if (_GetByteArrayRegion == null) + _GetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetCharArrayRegion { + get { + if (_GetCharArrayRegion == null) + _GetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetShortArrayRegion { + get { + if (_GetShortArrayRegion == null) + _GetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetIntArrayRegion { + get { + if (_GetIntArrayRegion == null) + _GetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetLongArrayRegion { + get { + if (_GetLongArrayRegion == null) + _GetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetFloatArrayRegion { + get { + if (_GetFloatArrayRegion == null) + _GetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetDoubleArrayRegion { + get { + if (_GetDoubleArrayRegion == null) + _GetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetDoubleArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetBooleanArrayRegion { + get { + if (_SetBooleanArrayRegion == null) + _SetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetByteArrayRegion { + get { + if (_SetByteArrayRegion == null) + _SetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetCharArrayRegion { + get { + if (_SetCharArrayRegion == null) + _SetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetShortArrayRegion { + get { + if (_SetShortArrayRegion == null) + _SetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetIntArrayRegion { + get { + if (_SetIntArrayRegion == null) + _SetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetLongArrayRegion { + get { + if (_SetLongArrayRegion == null) + _SetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetFloatArrayRegion { + get { + if (_SetFloatArrayRegion == null) + _SetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _SetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr SetDoubleArrayRegion { + get { + if (_SetDoubleArrayRegion == null) + _SetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _SetDoubleArrayRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_JniNativeMethodRegistrationArray_int_int _RegisterNatives; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_JniNativeMethodRegistrationArray_int_int RegisterNatives { + get { + if (_RegisterNatives == null) + _RegisterNatives = (JniFunc_JniEnvironmentSafeHandle_IntPtr_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_JniNativeMethodRegistrationArray_int_int)); + return _RegisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _UnregisterNatives; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int UnregisterNatives { + get { + if (_UnregisterNatives == null) + _UnregisterNatives = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _UnregisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _MonitorEnter; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int MonitorEnter { + get { + if (_MonitorEnter == null) + _MonitorEnter = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _MonitorEnter; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int _MonitorExit; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int MonitorExit { + get { + if (_MonitorExit == null) + _MonitorExit = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int)); + return _MonitorExit; + } + } + + JniFunc_JniEnvironmentSafeHandle_outIntPtr_int _GetJavaVM; + public JniFunc_JniEnvironmentSafeHandle_outIntPtr_int GetJavaVM { + get { + if (_GetJavaVM == null) + _GetJavaVM = (JniFunc_JniEnvironmentSafeHandle_outIntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JniEnvironmentSafeHandle_outIntPtr_int)); + return _GetJavaVM; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetStringRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetStringRegion { + get { + if (_GetStringRegion == null) + _GetStringRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetStringRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr _GetStringUTFRegion; + public JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr GetStringUTFRegion { + get { + if (_GetStringUTFRegion == null) + _GetStringUTFRegion = (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_int_int_IntPtr)); + return _GetStringUTFRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr _GetPrimitiveArrayCritical; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr GetPrimitiveArrayCritical { + get { + if (_GetPrimitiveArrayCritical == null) + _GetPrimitiveArrayCritical = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_IntPtr)); + return _GetPrimitiveArrayCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int _ReleasePrimitiveArrayCritical; + public JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int ReleasePrimitiveArrayCritical { + get { + if (_ReleasePrimitiveArrayCritical == null) + _ReleasePrimitiveArrayCritical = (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_IntPtr_int)); + return _ReleasePrimitiveArrayCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string _GetStringCritical; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string GetStringCritical { + get { + if (_GetStringCritical == null) + _GetStringCritical = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr_string)); + return _GetStringCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr_string _ReleaseStringCritical; + public JniAction_JniEnvironmentSafeHandle_IntPtr_string ReleaseStringCritical { + get { + if (_ReleaseStringCritical == null) + _ReleaseStringCritical = (JniAction_JniEnvironmentSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr_string)); + return _ReleaseStringCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject _NewWeakGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject NewWeakGlobalRef { + get { + if (_NewWeakGlobalRef == null) + _NewWeakGlobalRef = (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_jobject)); + return _NewWeakGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteWeakGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteWeakGlobalRef { + get { + if (_DeleteWeakGlobalRef == null) + _DeleteWeakGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteWeakGlobalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_bool _ExceptionCheck; + public JniFunc_JniEnvironmentSafeHandle_bool ExceptionCheck { + get { + if (_ExceptionCheck == null) + _ExceptionCheck = (JniFunc_JniEnvironmentSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JniEnvironmentSafeHandle_bool)); + return _ExceptionCheck; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject _NewDirectByteBuffer; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject NewDirectByteBuffer { + get { + if (_NewDirectByteBuffer == null) + _NewDirectByteBuffer = (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject)); + return _NewDirectByteBuffer; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr _GetDirectBufferAddress; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr GetDirectBufferAddress { + get { + if (_GetDirectBufferAddress == null) + _GetDirectBufferAddress = (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_IntPtr)); + return _GetDirectBufferAddress; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_long _GetDirectBufferCapacity; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_long GetDirectBufferCapacity { + get { + if (_GetDirectBufferCapacity == null) + _GetDirectBufferCapacity = (JniFunc_JniEnvironmentSafeHandle_IntPtr_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_long)); + return _GetDirectBufferCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_JniObjectReferenceType _GetObjectRefType; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_JniObjectReferenceType GetObjectRefType { + get { + if (_GetObjectRefType == null) + _GetObjectRefType = (JniFunc_JniEnvironmentSafeHandle_IntPtr_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_JniObjectReferenceType)); + return _GetObjectRefType; + } + } + } +} +#endif // FEATURE_HANDLES_ARE_INTPTRS diff --git a/tests/invocation-overhead/jni.cs b/tests/invocation-overhead/jni.cs new file mode 100644 index 000000000..d6961cdda --- /dev/null +++ b/tests/invocation-overhead/jni.cs @@ -0,0 +1,9471 @@ +// Generated file; DO NOT EDIT! +// +// To make changes, edit monodroid/tools/jnienv-gen-interop and rerun + +#if !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS +#define FEATURE_HANDLES_ARE_SAFE_HANDLES +#endif // !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS + +#if FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS +#define _NAMESPACE_PER_HANDLE +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS + +using System; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading; + +using Java.Interop; + +#if FEATURE_HANDLES_ARE_INTPTRS + using JNIEnvPtr = System.IntPtr; + using jinstanceFieldID = System.IntPtr; + using jstaticFieldID = System.IntPtr; + using jinstanceMethodID = System.IntPtr; + using jstaticMethodID = System.IntPtr; + using jobject = System.IntPtr; +#endif // FEATURE_HANDLES_ARE_INTPTRS + +namespace Java.Interop { + [StructLayout (LayoutKind.Sequential)] + partial struct JniNativeInterfaceStruct { + +#pragma warning disable 0649 // Field is assigned to, and will always have its default value `null`; ignore as it'll be set in native code. +#pragma warning disable 0169 // Field never used; ignore since these fields make the structure have the right layout. + private IntPtr reserved0; // void* + private IntPtr reserved1; // void* + private IntPtr reserved2; // void* + private IntPtr reserved3; // void* + public IntPtr GetVersion; // jint (*GetVersion)(JNIEnv*); + public IntPtr DefineClass; // jclass (*DefineClass)(JNIEnv*, const char, jobject, const jbyte*, jsize); + public IntPtr FindClass; // jclass (*FindClass)(JNIEnv*, const char*); + public IntPtr FromReflectedMethod; // jmethodID (*FromReflectedMethod)(JNIEnv*, jobject); + public IntPtr FromReflectedField; // jfieldID (*FromReflectedField)(JNIEnv*, jobject); + public IntPtr ToReflectedMethod; // jobject (*ToReflectedMethod)(JNIEnv*, jclass, jmethodID, jboolean); + public IntPtr GetSuperclass; // jclass (*GetSuperclass)(JNIEnv*, jclass); + public IntPtr IsAssignableFrom; // jboolean (*IsAssignableFrom)(JNIEnv*, jclass, jclass); + public IntPtr ToReflectedField; // jobject (*ToReflectedField)(JNIEnv*, jclass, jfieldID, jboolean); + public IntPtr Throw; // jint (*Throw)(JNIEnv*, jthrowable); + public IntPtr ThrowNew; // jint (*ThrowNew)(JNIEnv*, jclass, const char*); + public IntPtr ExceptionOccurred; // jthrowable (*ExceptionOccurred)(JNIEnv*); + public IntPtr ExceptionDescribe; // void (*ExceptionDescribe)(JNIEnv*); + public IntPtr ExceptionClear; // void (*ExceptionClear)(JNIEnv*); + public IntPtr FatalError; // void (*FatalError)(JNIEnv*, const char*); + public IntPtr PushLocalFrame; // jint (*PushLocalFrame)(JNIEnv*, jint); + public IntPtr PopLocalFrame; // jobject (*PopLocalFrame)(JNIEnv*, jobject); + public IntPtr NewGlobalRef; // jobject (*NewGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteGlobalRef; // void (*DeleteGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteLocalRef; // void (*DeleteLocalRef)(JNIEnv*, jobject); + public IntPtr IsSameObject; // jboolean (*IsSameObject)(JNIEnv*, jobject, jobject); + public IntPtr NewLocalRef; // jobject (*NewLocalRef)(JNIEnv*, jobject); + public IntPtr EnsureLocalCapacity; // jint (*EnsureLocalCapacity)(JNIEnv*, jint); + public IntPtr AllocObject; // jobject (*AllocObject)(JNIEnv*, jclass); + public IntPtr NewObject; // jobject (*NewObject)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr NewObjectV; // jobject (*NewObjectV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr NewObjectA; // jobject (*NewObjectA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr GetObjectClass; // jclass (*GetObjectClass)(JNIEnv*, jobject); + public IntPtr IsInstanceOf; // jboolean (*IsInstanceOf)(JNIEnv*, jobject, jclass); + public IntPtr GetMethodID; // jmethodID (*GetMethodID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr CallObjectMethod; // jobject (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallObjectMethodV; // jobject (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallObjectMethodA; // jobject (*CallObjectMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallBooleanMethod; // jboolean (*CallBooleanMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallBooleanMethodV; // jboolean (*CallBooleanMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallBooleanMethodA; // jboolean (*CallBooleanMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallSByteMethod; // jbyte (*CallByteMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallSByteMethodV; // jbyte (*CallByteMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallSByteMethodA; // jbyte (*CallByteMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallCharMethod; // jchar (*CallCharMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallCharMethodV; // jchar (*CallCharMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallCharMethodA; // jchar (*CallCharMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallShortMethod; // jshort (*CallShortMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallShortMethodV; // jshort (*CallShortMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallShortMethodA; // jshort (*CallShortMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallIntMethod; // jint (*CallIntMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallIntMethodV; // jint (*CallIntMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallIntMethodA; // jint (*CallIntMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallLongMethod; // jlong (*CallLongMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallLongMethodV; // jlong (*CallLongMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallLongMethodA; // jlong (*CallLongMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallFloatMethod; // jfloat (*CallFloatMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallFloatMethodV; // jfloat (*CallFloatMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallFloatMethodA; // jfloat (*CallFloatMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallDoubleMethod; // jdouble (*CallDoubleMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallDoubleMethodV; // jdouble (*CallDoubleMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallDoubleMethodA; // jdouble (*CallDoubleMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallVoidMethod; // void (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...); + public IntPtr CallVoidMethodV; // void (*CallVoidMethodV)(JNIEnv*, jobject, jmethodID, va_list); + public IntPtr CallVoidMethodA; // void (*CallVoidMethodA)(JNIEnv*, jobject, jmethodID, jvalue*); + public IntPtr CallNonvirtualObjectMethod; // jobject (*CallNonvirtualObjectMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualObjectMethodV; // jobject (*CallNonvirtualObjectMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualObjectMethodA; // jobject (*CallNonvirtualObjectMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualBooleanMethod; // jboolean (*CallNonvirtualBooleanMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualBooleanMethodV; // jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualBooleanMethodA; // jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualSByteMethod; // jbyte (*CallNonvirtualByteMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualSByteMethodV; // jbyte (*CallNonvirtualByteMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualSByteMethodA; // jbyte (*CallNonvirtualSByteMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualCharMethod; // jchar (*CallNonvirtualCharMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualCharMethodV; // jchar (*CallNonvirtualCharMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualCharMethodA; // jchar (*CallNonvirtualCharMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualShortMethod; // jshort (*CallNonvirtualShortMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualShortMethodV; // jshort (*CallNonvirtualShortMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualShortMethodA; // jshort (*CallNonvirtualShortMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualIntMethod; // jint (*CallNonvirtualIntMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualIntMethodV; // jint (*CallNonvirtualIntMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualIntMethodA; // jint (*CallNonvirtualIntMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualLongMethod; // jlong (*CallNonvirtualLongMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualLongMethodV; // jlong (*CallNonvirtualLongMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualLongMethodA; // jlong (*CallNonvirtualLongMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualFloatMethod; // jfloat (*CallNonvirtualFloatMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualFloatMethodV; // jfloat (*CallNonvirtualFloatMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualFloatMethodA; // jfloat (*CallNonvirtualFloatMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualDoubleMethod; // jdouble (*CallNonvirtualDoubleMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualDoubleMethodV; // jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualDoubleMethodA; // jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr CallNonvirtualVoidMethod; // void (*CallNonvirtualVoidMethod)(JNIEnv*, jobject, jclass, jmethodID, ...); + public IntPtr CallNonvirtualVoidMethodV; // void (*CallNonvirtualVoidMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list); + public IntPtr CallNonvirtualVoidMethodA; // void (*CallNonvirtualVoidMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*); + public IntPtr GetFieldID; // jfieldID (*GetFieldID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr GetObjectField; // jobject (*GetObjectField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetBooleanField; // jboolean (*GetBooleanField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetByteField; // jbyte (*GetByteField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetCharField; // jchar (*GetCharField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetShortField; // jshort (*GetShortField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetIntField; // jint (*GetIntField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetLongField; // jlong (*GetLongField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetFloatField; // jfloat (*GetFloatField)(JNIEnv*, jobject, jfieldID); + public IntPtr GetDoubleField; // jdouble (*GetDoubleField)(JNIEnv*, jobject, jfieldID); + public IntPtr SetObjectField; // void (*SetObjectField)(JNIEnv*, jobject, jfieldID, jobject); + public IntPtr SetBooleanField; // void (*SetBooleanField)(JNIEnv*, jobject, jfieldID, jboolean); + public IntPtr SetByteField; // void (*SetByteField)(JNIEnv*, jobject, jfieldID, jbyte); + public IntPtr SetCharField; // void (*SetCharField)(JNIEnv*, jobject, jfieldID, jchar); + public IntPtr SetShortField; // void (*SetShortField)(JNIEnv*, jobject, jfieldID, jshort); + public IntPtr SetIntField; // void (*SetIntField)(JNIEnv*, jobject, jfieldID, jint); + public IntPtr SetLongField; // void (*SetLongField)(JNIEnv*, jobject, jfieldID, jlong); + public IntPtr SetFloatField; // void (*SetFloatField)(JNIEnv*, jobject, jfieldID, jfloat); + public IntPtr SetDoubleField; // void (*SetDoubleField)(JNIEnv*, jobject, jfieldID, jdouble); + public IntPtr GetStaticMethodID; // jmethodID (*GetStaticMethodID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr CallStaticObjectMethod; // jobject (*CallStaticObjectMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticObjectMethodV; // jobject (*CallStaticObjectMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticObjectMethodA; // jobject (*CallStaticObjectMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticBooleanMethod; // jboolean (*CallStaticBooleanMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticBooleanMethodV; // jboolean (*CallStaticBooleanMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticBooleanMethodA; // jboolean (*CallStaticBooleanMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticSByteMethod; // jbyte (*CallStaticByteMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticSByteMethodV; // jbyte (*CallStaticSByteMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticSByteMethodA; // jbyte (*CallStaticByteMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticCharMethod; // jchar (*CallStaticCharMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticCharMethodV; // jchar (*CallStaticCharMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticCharMethodA; // jchar (*CallStaticCharMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticShortMethod; // jshort (*CallStaticShortMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticShortMethodV; // jshort (*CallStaticShortMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticShortMethodA; // jshort (*CallStaticShortMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticIntMethod; // jint (*CallStaticIntMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticIntMethodV; // jint (*CallStaticIntMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticIntMethodA; // jint (*CallStaticIntMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticLongMethod; // jlong (*CallStaticLongMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticLongMethodV; // jlong (*CallStaticLongMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticLongMethodA; // jlong (*CallStaticLongMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticFloatMethod; // jfloat (*CallStaticFloatMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticFloatMethodV; // jfloat (*CallStaticFloatMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticFloatMethodA; // jfloat (*CallStaticFloatMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticDoubleMethod; // jdouble (*CallStaticDoubleMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticDoubleMethodV; // jdouble (*CallStaticDoubleMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticDoubleMethodA; // jdouble (*CallStaticDoubleMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr CallStaticVoidMethod; // void (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...); + public IntPtr CallStaticVoidMethodV; // void (*CallStaticVoidMethodV)(JNIEnv*, jclass, jmethodID, va_list); + public IntPtr CallStaticVoidMethodA; // void (*CallStaticVoidMethodA)(JNIEnv*, jclass, jmethodID, jvalue*); + public IntPtr GetStaticFieldID; // jstaticfieldID (*GetStaticFieldID)(JNIEnv*, jclass, const char*, const char*); + public IntPtr GetStaticObjectField; // jobject (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticBooleanField; // jboolean (*GetStaticBooleanField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticByteField; // jbyte (*GetStaticByteField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticCharField; // jchar (*GetStaticCharField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticShortField; // jshort (*GetStaticShortField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticIntField; // jint (*GetStaticIntField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticLongField; // jlong (*GetStaticLongField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticFloatField; // jfloat (*GetStaticFloatField)(JNIEnv*, jclass, jfieldID); + public IntPtr GetStaticDoubleField; // jdouble (*GetStaticDoubleField)(JNIEnv*, jclass, jfieldID); + public IntPtr SetStaticObjectField; // void (*SetStaticObjectField)(JNIEnv*, jclass, jfieldID, jobject); + public IntPtr SetStaticBooleanField; // void (*SetStaticBooleanField)(JNIEnv*, jclass, jfieldID, jboolean); + public IntPtr SetStaticByteField; // void (*SetStaticByteField)(JNIEnv*, jclass, jfieldID, jbyte); + public IntPtr SetStaticCharField; // void (*SetStaticCharField)(JNIEnv*, jclass, jfieldID, jchar); + public IntPtr SetStaticShortField; // void (*SetStaticShortField)(JNIEnv*, jclass, jfieldID, jshort); + public IntPtr SetStaticIntField; // void (*SetStaticIntField)(JNIEnv*, jclass, jfieldID, jint); + public IntPtr SetStaticLongField; // void (*SetStaticLongField)(JNIEnv*, jclass, jfieldID, jlong); + public IntPtr SetStaticFloatField; // void (*SetStaticFloatField)(JNIEnv*, jclass, jfieldID, jfloat); + public IntPtr SetStaticDoubleField; // void (*SetStaticDoubleField)(JNIEnv*, jclass, jfieldID, jdouble); + public IntPtr NewString; // jstring (*NewString)(JNIEnv*, const jchar*, jsize); + public IntPtr GetStringLength; // jsize (*GetStringLength)(JNIEnv*, jstring); + public IntPtr GetStringChars; // const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringChars; // void (*ReleaseStringChars)(JNIEnv*, jstring, const jchar*); + public IntPtr NewStringUTF; // jstring (*NewStringUTF)(JNIEnv*, const char*); + public IntPtr GetStringUTFLength; // jsize (*GetStringUTFLength)(JNIEnv*, jstring); + public IntPtr GetStringUTFChars; // const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringUTFChars; // void (*ReleaseStringUTFChars)(JNIEnv*, jstring, const char*); + public IntPtr GetArrayLength; // jsize (*GetArrayLength)(JNIEnv*, jarray); + public IntPtr NewObjectArray; // jobjectArray (*NewObjectArray)(JNIEnv*, jsize, jclass, jobject); + public IntPtr GetObjectArrayElement; // jobject (*GetObjectArrayElement)(JNIEnv*, jobjectArray, jsize); + public IntPtr SetObjectArrayElement; // void (*SetObjectArrayElement)(JNIEnv*, jobjectArray, jsize, jobject); + public IntPtr NewBooleanArray; // jbooleanArray (*NewBooleanArray)(JNIEnv*, jsize); + public IntPtr NewByteArray; // jbyteArray (*NewByteArray)(JNIEnv*, jsize); + public IntPtr NewCharArray; // jcharArray (*NewCharArray)(JNIEnv*, jsize); + public IntPtr NewShortArray; // jshortArray (*NewShortArray)(JNIEnv*, jsize); + public IntPtr NewIntArray; // jintArray (*NewIntArray)(JNIEnv*, jsize); + public IntPtr NewLongArray; // jlongArray (*NewLongArray)(JNIEnv*, jsize); + public IntPtr NewFloatArray; // jfloatArray (*NewFloatArray)(JNIEnv*, jsize); + public IntPtr NewDoubleArray; // jdoubleArray (*NewDoubleArray)(JNIEnv*, jsize); + public IntPtr GetBooleanArrayElements; // jboolean* (*GetBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*); + public IntPtr GetByteArrayElements; // jbyte* (*GetByteArrayElements)(JNIEnv*, jbyteArray, jboolean*); + public IntPtr GetCharArrayElements; // jchar* (*GetCharArrayElements)(JNIEnv*, jcharArray, jboolean*); + public IntPtr GetShortArrayElements; // jshort* (*GetShortArrayElements)(JNIEnv*, jshortArray, jboolean*); + public IntPtr GetIntArrayElements; // jint* (*GetIntArrayElements)(JNIEnv*, jintArray, jboolean*); + public IntPtr GetLongArrayElements; // jlong* (*GetLongArrayElements)(JNIEnv*, jlongArray, jboolean*); + public IntPtr GetFloatArrayElements; // jfloat* (*GetFloatArrayElements)(JNIEnv*, jfloatArray, jboolean*); + public IntPtr GetDoubleArrayElements; // jdouble* (*GetDoubleArrayElements)(JNIEnv*, jdoubleArray, jboolean*); + public IntPtr ReleaseBooleanArrayElements; // void (*ReleaseBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*, jint); + public IntPtr ReleaseByteArrayElements; // void (*ReleaseByteArrayElements)(JNIEnv*, jbyteArray, jbyte*, jint); + public IntPtr ReleaseCharArrayElements; // void (*ReleaseCharArrayElements)(JNIEnv*, jcharArray, jchar*, jint); + public IntPtr ReleaseShortArrayElements; // void (*ReleaseShortArrayElements)(JNIEnv*, jshortArray, jshort*, jint); + public IntPtr ReleaseIntArrayElements; // void (*ReleaseIntArrayElements)(JNIEnv*, jintArray, jint*, jint); + public IntPtr ReleaseLongArrayElements; // void (*ReleaseLongArrayElements)(JNIEnv*, jlongArray, jlong*, jint); + public IntPtr ReleaseFloatArrayElements; // void (*ReleaseFloatArrayElements)(JNIEnv*, jfloatArray, jfloat*, jint); + public IntPtr ReleaseDoubleArrayElements; // void (*ReleaseDoubleArrayElements)(JNIEnv*, jdoubleArray, jdouble*, jint); + public IntPtr GetBooleanArrayRegion; // void (*GetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, jboolean*); + public IntPtr GetByteArrayRegion; // void (*GetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, jbyte*); + public IntPtr GetCharArrayRegion; // void (*GetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, jchar*); + public IntPtr GetShortArrayRegion; // void (*GetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, jshort*); + public IntPtr GetIntArrayRegion; // void (*GetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, jint*); + public IntPtr GetLongArrayRegion; // void (*GetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, jlong*); + public IntPtr GetFloatArrayRegion; // void (*GetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, jfloat*); + public IntPtr GetDoubleArrayRegion; // void (*GetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, jdouble*); + public IntPtr SetBooleanArrayRegion; // void (*SetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, const jboolean*); + public IntPtr SetByteArrayRegion; // void (*SetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, const jbyte*); + public IntPtr SetCharArrayRegion; // void (*SetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, const jchar*); + public IntPtr SetShortArrayRegion; // void (*SetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, const jshort*); + public IntPtr SetIntArrayRegion; // void (*SetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, const jint*); + public IntPtr SetLongArrayRegion; // void (*SetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, const jlong*); + public IntPtr SetFloatArrayRegion; // void (*SetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, const jfloat*); + public IntPtr SetDoubleArrayRegion; // void (*SetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, const jdouble*); + public IntPtr RegisterNatives; // jint (*RegisterNatives)(JNIEnv*, jclass, const JNINativeMethod*, jint); + public IntPtr UnregisterNatives; // jint (*UnregisterNatives)(JNIEnv*, jclass); + public IntPtr MonitorEnter; // jint (*MonitorEnter)(JNIEnv*, jobject); + public IntPtr MonitorExit; // jint (*MonitorExit)(JNIEnv*, jobject); + public IntPtr GetJavaVM; // jint (*GetJavaVM)(JNIEnv*, JavaVM**); + public IntPtr GetStringRegion; // void (*GetStringRegion)(JNIEnv*, jstring, jsize, jsize, jchar*); + public IntPtr GetStringUTFRegion; // void (*GetStringUTFRegion)(JNIEnv*, jstring, jsize, jsize, char*); + public IntPtr GetPrimitiveArrayCritical; // void* (*GetPrimitiveArrayCritical)(JNIEnv*, jarray, jboolean*); + public IntPtr ReleasePrimitiveArrayCritical; // void (*ReleasePrimitiveArrayCritical)(JNIEnv*, jarray, void*, jint); + public IntPtr GetStringCritical; // const jchar* (*GetStringCritical)(JNIEnv*, jstring, jboolean*); + public IntPtr ReleaseStringCritical; // void (*ReleaseStringCritical)(JNIEnv*, jstring, const jchar*); + public IntPtr NewWeakGlobalRef; // jweak (*NewWeakGlobalRef)(JNIEnv*, jobject); + public IntPtr DeleteWeakGlobalRef; // void (*DeleteWeakGlobalRef)(JNIEnv*, jweak); + public IntPtr ExceptionCheck; // jboolean (*ExceptionCheck)(JNIEnv*); + public IntPtr NewDirectByteBuffer; // jobject (*NewDirectByteBuffer)(JNIEnv*, void*, jlong); + public IntPtr GetDirectBufferAddress; // void* (*GetDirectBufferAddress)(JNIEnv*, jobject); + public IntPtr GetDirectBufferCapacity; // jlong (*GetDirectBufferCapacity)(JNIEnv*, jobject); + public IntPtr GetObjectRefType; // jobjectRefType (*GetObjectRefType)(JNIEnv*, jobject); +#pragma warning restore 0169 +#pragma warning restore 0649 + } +} +#if FEATURE_HANDLES_ARE_SAFE_HANDLES +namespace +#if _NAMESPACE_PER_HANDLE + Java.Interop.SafeHandles +#else + Java.Interop +#endif +{ + + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int (JniEnvironmentSafeHandle env); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference (JniEnvironmentSafeHandle env, string name, JniReferenceSafeHandle loader, IntPtr buf, int bufLen); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference (JniEnvironmentSafeHandle env, string classname); + unsafe delegate JniInstanceMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle method); + unsafe delegate JniInstanceFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle field); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle cls, JniInstanceMethodID jmethod, bool isStatic); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle clazz1, JniReferenceSafeHandle clazz2); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle cls, JniInstanceFieldID jfieldID, bool isStatic); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle obj); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle clazz, string message); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle (JniEnvironmentSafeHandle env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_string (JniEnvironmentSafeHandle env, string msg); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int_int (JniEnvironmentSafeHandle env, int capacity); + unsafe delegate JniGlobalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr (JniEnvironmentSafeHandle env, IntPtr jobject); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniInstanceMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle kls, string name, string signature); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms); + unsafe delegate JniInstanceFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, JniReferenceSafeHandle val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, double val); + unsafe delegate JniStaticMethodID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms); + unsafe delegate JniStaticFieldID JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, string name, string sig); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, JniReferenceSafeHandle val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, double val); + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl, CharSet=CharSet.Unicode)] + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference (JniEnvironmentSafeHandle env, IntPtr unicodeChars, int len); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr chars); + unsafe delegate string JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string (JniEnvironmentSafeHandle env, JniReferenceSafeHandle @string, string utf); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference (JniEnvironmentSafeHandle env, int length, JniReferenceSafeHandle elementClass, JniReferenceSafeHandle initialElement); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int index); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int index, JniReferenceSafeHandle value); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference (JniEnvironmentSafeHandle env, int length); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, IntPtr elems, int mode); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle array, int start, int len, IntPtr buf); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jclass, JniNativeMethodRegistration [] methods, int nMethods); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int (JniEnvironmentSafeHandle env, out JavaVMSafeHandle vm); + unsafe delegate JniWeakGlobalReference JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_bool (JniEnvironmentSafeHandle env); + unsafe delegate JniLocalReference JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference (JniEnvironmentSafeHandle env, IntPtr address, long capacity); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr (JniEnvironmentSafeHandle env, JniReferenceSafeHandle buf); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long (JniEnvironmentSafeHandle env, JniReferenceSafeHandle buf); + unsafe delegate JniObjectReferenceType JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType (JniEnvironmentSafeHandle env, JniReferenceSafeHandle jobject); + + partial class JniEnvironment { + + internal static partial class Activator { + + public static unsafe JniLocalReference AllocObject (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.AllocObject (JniEnvironment.Current.SafeHandle, jclass); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewObject (JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObject (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewObject (JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + } + + public static partial class Arrays { + + public static unsafe int GetArrayLength (JniReferenceSafeHandle array_ptr) + { + if (array_ptr == null) + throw new ArgumentNullException ("array_ptr"); + if (array_ptr.IsInvalid) + throw new ArgumentException ("array_ptr"); + + var tmp = JniEnvironment.Current.Invoker.GetArrayLength (JniEnvironment.Current.SafeHandle, array_ptr); + return tmp; + } + + public static unsafe JniLocalReference NewObjectArray (int length, JniReferenceSafeHandle elementClass, JniReferenceSafeHandle initialElement) + { + if (elementClass == null) + throw new ArgumentNullException ("elementClass"); + if (elementClass.IsInvalid) + throw new ArgumentException ("elementClass"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectArray (JniEnvironment.Current.SafeHandle, length, elementClass, initialElement); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference GetObjectArrayElement (JniReferenceSafeHandle array, int index) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe void SetObjectArrayElement (JniReferenceSafeHandle array, int index, JniReferenceSafeHandle value) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + JniEnvironment.Current.Invoker.SetObjectArrayElement (JniEnvironment.Current.SafeHandle, array, index, value); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniLocalReference NewBooleanArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewBooleanArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewByteArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewByteArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewCharArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewCharArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewShortArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewShortArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewIntArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewIntArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewLongArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewLongArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewFloatArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewFloatArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference NewDoubleArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewDoubleArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetBooleanArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetByteArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetByteArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetCharArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetCharArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetShortArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetShortArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetIntArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetIntArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetLongArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetLongArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetFloatArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe IntPtr GetDoubleArrayElements (JniReferenceSafeHandle array, IntPtr isCopy) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, isCopy); + return tmp; + } + + public static unsafe void ReleaseBooleanArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseBooleanArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseByteArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseByteArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseCharArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseCharArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseShortArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseShortArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseIntArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseIntArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseLongArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseLongArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseFloatArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseFloatArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + public static unsafe void ReleaseDoubleArrayElements (JniReferenceSafeHandle array, IntPtr elems, int mode) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseDoubleArrayElements (JniEnvironment.Current.SafeHandle, array, elems, mode); + } + + internal static unsafe void GetBooleanArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetByteArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetCharArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetShortArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetIntArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetLongArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetFloatArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetDoubleArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void SetBooleanArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetByteArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetByteArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetCharArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetCharArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetShortArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetShortArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetIntArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetIntArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetLongArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetLongArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetFloatArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetDoubleArrayRegion (JniReferenceSafeHandle array, int start, int len, IntPtr buf) + { + if (array == null) + throw new ArgumentNullException ("array"); + if (array.IsInvalid) + throw new ArgumentException ("array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + } + + public static partial class Errors { + + public static unsafe int Throw (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.Throw (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int ThrowNew (JniReferenceSafeHandle clazz, string message) + { + if (clazz == null) + throw new ArgumentNullException ("clazz"); + if (clazz.IsInvalid) + throw new ArgumentException ("clazz"); + if (message == null) + throw new ArgumentNullException ("message"); + + var tmp = JniEnvironment.Current.Invoker.ThrowNew (JniEnvironment.Current.SafeHandle, clazz, message); + return tmp; + } + + internal static unsafe JniLocalReference ExceptionOccurred () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionOccurred (JniEnvironment.Current.SafeHandle); + return tmp; + } + + internal static unsafe void ExceptionDescribe () + { + JniEnvironment.Current.Invoker.ExceptionDescribe (JniEnvironment.Current.SafeHandle); + } + + internal static unsafe void ExceptionClear () + { + JniEnvironment.Current.Invoker.ExceptionClear (JniEnvironment.Current.SafeHandle); + } + + public static unsafe void FatalError (string msg) + { + if (msg == null) + throw new ArgumentNullException ("msg"); + + JniEnvironment.Current.Invoker.FatalError (JniEnvironment.Current.SafeHandle, msg); + } + + internal static unsafe bool ExceptionCheck () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionCheck (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + + public static partial class Handles { + + public static unsafe int PushLocalFrame (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.PushLocalFrame (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe JniLocalReference PopLocalFrame (JniReferenceSafeHandle result) + { + var tmp = JniEnvironment.Current.Invoker.PopLocalFrame (JniEnvironment.Current.SafeHandle, result); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniGlobalReference NewGlobalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe void DeleteLocalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteLocalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniLocalReference NewLocalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewLocalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + public static unsafe int EnsureLocalCapacity (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.EnsureLocalCapacity (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe int GetJavaVM (out JavaVMSafeHandle vm) + { + var tmp = JniEnvironment.Current.Invoker.GetJavaVM (JniEnvironment.Current.SafeHandle, out vm); + return tmp; + } + + internal static unsafe JniWeakGlobalReference NewWeakGlobalRef (JniReferenceSafeHandle jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + + internal static unsafe void DeleteWeakGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniObjectReferenceType GetObjectRefType (JniReferenceSafeHandle jobject) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectRefType (JniEnvironment.Current.SafeHandle, jobject); + return tmp; + } + } + + public static partial class IO { + + public static unsafe JniLocalReference NewDirectByteBuffer (IntPtr address, long capacity) + { + if (address == IntPtr.Zero) + throw new ArgumentException ("'address' must not be IntPtr.Zero.", "address"); + + var tmp = JniEnvironment.Current.Invoker.NewDirectByteBuffer (JniEnvironment.Current.SafeHandle, address, capacity); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe IntPtr GetDirectBufferAddress (JniReferenceSafeHandle buf) + { + if (buf == null) + throw new ArgumentNullException ("buf"); + if (buf.IsInvalid) + throw new ArgumentException ("buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferAddress (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + + public static unsafe long GetDirectBufferCapacity (JniReferenceSafeHandle buf) + { + if (buf == null) + throw new ArgumentNullException ("buf"); + if (buf.IsInvalid) + throw new ArgumentException ("buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferCapacity (JniEnvironment.Current.SafeHandle, buf); + return tmp; + } + } + + internal static partial class Members { + + internal static unsafe JniLocalReference ToReflectedMethod (JniReferenceSafeHandle cls, JniInstanceMethodID jmethod, bool isStatic) + { + if (cls == null) + throw new ArgumentNullException ("cls"); + if (cls.IsInvalid) + throw new ArgumentException ("cls"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedMethod (JniEnvironment.Current.SafeHandle, cls, jmethod, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference ToReflectedField (JniReferenceSafeHandle cls, JniInstanceFieldID jfieldID, bool isStatic) + { + if (cls == null) + throw new ArgumentNullException ("cls"); + if (cls.IsInvalid) + throw new ArgumentException ("cls"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedField (JniEnvironment.Current.SafeHandle, cls, jfieldID, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniInstanceMethodID GetMethodID (JniReferenceSafeHandle kls, string name, string signature) + { + if (kls == null) + throw new ArgumentNullException ("kls"); + if (kls.IsInvalid) + throw new ArgumentException ("kls"); + if (name == null) + throw new ArgumentNullException ("name"); + if (signature == null) + throw new ArgumentNullException ("signature"); + + var tmp = JniEnvironment.Current.Invoker.GetMethodID (JniEnvironment.Current.SafeHandle, kls, name, signature); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference CallObjectMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallObjectMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallBooleanMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallBooleanMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallVoidMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallVoidMethod (JniReferenceSafeHandle jobject, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallNonvirtualObjectMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallNonvirtualVoidMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethod (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallNonvirtualVoidMethod (JniReferenceSafeHandle jobject, JniReferenceSafeHandle jclass, JniInstanceMethodID jmethod, JValue* parms) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethodA (JniEnvironment.Current.SafeHandle, jobject, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniInstanceFieldID GetFieldID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference GetObjectField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetBooleanField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetByteField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe char GetCharField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe short GetShortField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe int GetIntField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe long GetLongField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe float GetFloatField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe double GetDoubleField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID); + return tmp; + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, JniReferenceSafeHandle val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetObjectField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, bool val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetBooleanField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, sbyte val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetByteField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, char val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetCharField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, short val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetShortField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, int val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetIntField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, long val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetLongField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, float val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetFloatField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + internal static unsafe void SetField (JniReferenceSafeHandle jobject, JniInstanceFieldID jfieldID, double val) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetDoubleField (JniEnvironment.Current.SafeHandle, jobject, jfieldID, val); + } + + public static unsafe JniStaticMethodID GetStaticMethodID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticMethodID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference CallStaticObjectMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe JniLocalReference CallStaticObjectMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallStaticVoidMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethod (JniEnvironment.Current.SafeHandle, jclass, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallStaticVoidMethod (JniReferenceSafeHandle jclass, JniStaticMethodID jmethod, JValue* parms) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jmethod == null) + throw new ArgumentNullException ("jmethod"); + if (jmethod.IsInvalid) + throw new ArgumentException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethodA (JniEnvironment.Current.SafeHandle, jclass, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniStaticFieldID GetStaticFieldID (JniReferenceSafeHandle jclass, string name, string sig) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFieldID (JniEnvironment.Current.SafeHandle, jclass, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniLocalReference GetStaticObjectField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe bool GetStaticBooleanField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetStaticByteField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe char GetStaticCharField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe short GetStaticShortField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe int GetStaticIntField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe long GetStaticLongField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe float GetStaticFloatField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe double GetStaticDoubleField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID); + return tmp; + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, JniReferenceSafeHandle val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, bool val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, sbyte val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticByteField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, char val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticCharField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, short val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticShortField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, int val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticIntField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, long val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticLongField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, float val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniReferenceSafeHandle jclass, JniStaticFieldID jfieldID, double val) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + if (jfieldID == null) + throw new ArgumentNullException ("jfieldID"); + if (jfieldID.IsInvalid) + throw new ArgumentException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass, jfieldID, val); + } + } + + internal static partial class Monitors { + + public static unsafe int MonitorEnter (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorEnter (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + + public static unsafe int MonitorExit (JniReferenceSafeHandle obj) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorExit (JniEnvironment.Current.SafeHandle, obj); + return tmp; + } + } + + public static partial class Strings { + + internal static unsafe JniLocalReference NewString (IntPtr unicodeChars, int len) + { + if (unicodeChars == IntPtr.Zero) + throw new ArgumentException ("'unicodeChars' must not be IntPtr.Zero.", "unicodeChars"); + + var tmp = JniEnvironment.Current.Invoker.NewString (JniEnvironment.Current.SafeHandle, unicodeChars, len); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + internal static unsafe int GetStringLength (JniReferenceSafeHandle @string) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringLength (JniEnvironment.Current.SafeHandle, @string); + return tmp; + } + + internal static unsafe IntPtr GetStringChars (JniReferenceSafeHandle @string, IntPtr isCopy) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringChars (JniEnvironment.Current.SafeHandle, @string, isCopy); + return tmp; + } + + internal static unsafe void ReleaseStringChars (JniReferenceSafeHandle @string, IntPtr chars) + { + if (@string == null) + throw new ArgumentNullException ("@string"); + if (@string.IsInvalid) + throw new ArgumentException ("@string"); + if (chars == IntPtr.Zero) + throw new ArgumentException ("'chars' must not be IntPtr.Zero.", "chars"); + + JniEnvironment.Current.Invoker.ReleaseStringChars (JniEnvironment.Current.SafeHandle, @string, chars); + } + } + + public static partial class Types { + + internal static unsafe JniLocalReference DefineClass (string name, JniReferenceSafeHandle loader, IntPtr buf, int bufLen) + { + if (name == null) + throw new ArgumentNullException ("name"); + if (loader == null) + throw new ArgumentNullException ("loader"); + if (loader.IsInvalid) + throw new ArgumentException ("loader"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.DefineClass (JniEnvironment.Current.SafeHandle, name, loader, buf, bufLen); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference FindClass (string classname) + { + if (classname == null) + throw new ArgumentNullException ("classname"); + + var tmp = JniEnvironment.Current.Invoker.FindClass (JniEnvironment.Current.SafeHandle, classname); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe JniLocalReference GetSuperclass (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.GetSuperclass (JniEnvironment.Current.SafeHandle, jclass); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsAssignableFrom (JniReferenceSafeHandle clazz1, JniReferenceSafeHandle clazz2) + { + if (clazz1 == null) + throw new ArgumentNullException ("clazz1"); + if (clazz1.IsInvalid) + throw new ArgumentException ("clazz1"); + if (clazz2 == null) + throw new ArgumentNullException ("clazz2"); + if (clazz2.IsInvalid) + throw new ArgumentException ("clazz2"); + + var tmp = JniEnvironment.Current.Invoker.IsAssignableFrom (JniEnvironment.Current.SafeHandle, clazz1, clazz2); + return tmp; + } + + public static unsafe bool IsSameObject (JniReferenceSafeHandle ref1, JniReferenceSafeHandle ref2) + { + var tmp = JniEnvironment.Current.Invoker.IsSameObject (JniEnvironment.Current.SafeHandle, ref1, ref2); + return tmp; + } + + public static unsafe JniLocalReference GetObjectClass (JniReferenceSafeHandle jobject) + { + if (jobject == null) + throw new ArgumentNullException ("jobject"); + if (jobject.IsInvalid) + throw new ArgumentException ("jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectClass (JniEnvironment.Current.SafeHandle, jobject); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return tmp; + } + + public static unsafe bool IsInstanceOf (JniReferenceSafeHandle obj, JniReferenceSafeHandle clazz) + { + if (obj == null) + throw new ArgumentNullException ("obj"); + if (obj.IsInvalid) + throw new ArgumentException ("obj"); + if (clazz == null) + throw new ArgumentNullException ("clazz"); + if (clazz.IsInvalid) + throw new ArgumentException ("clazz"); + + var tmp = JniEnvironment.Current.Invoker.IsInstanceOf (JniEnvironment.Current.SafeHandle, obj, clazz); + return tmp; + } + + internal static unsafe int RegisterNatives (JniReferenceSafeHandle jclass, JniNativeMethodRegistration [] methods, int nMethods) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.RegisterNatives (JniEnvironment.Current.SafeHandle, jclass, methods, nMethods); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int UnregisterNatives (JniReferenceSafeHandle jclass) + { + if (jclass == null) + throw new ArgumentNullException ("jclass"); + if (jclass.IsInvalid) + throw new ArgumentException ("jclass"); + + var tmp = JniEnvironment.Current.Invoker.UnregisterNatives (JniEnvironment.Current.SafeHandle, jclass); + return tmp; + } + } + + internal static partial class Versions { + + internal static unsafe int GetVersion () + { + var tmp = JniEnvironment.Current.Invoker.GetVersion (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + } + + partial class JniEnvironmentInvoker { + + internal JniNativeInterfaceStruct env; + + public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) + { + env = *p; + } + + + JniFunc_JniEnvironmentSafeHandle_int _GetVersion; + public JniFunc_JniEnvironmentSafeHandle_int GetVersion { + get { + if (_GetVersion == null) + _GetVersion = (JniFunc_JniEnvironmentSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JniEnvironmentSafeHandle_int)); + return _GetVersion; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference _DefineClass; + public JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference DefineClass { + get { + if (_DefineClass == null) + _DefineClass = (JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniReferenceSafeHandle_IntPtr_int_JniLocalReference)); + return _DefineClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference _FindClass; + public JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference FindClass { + get { + if (_FindClass == null) + _FindClass = (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference)); + return _FindClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _FromReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID FromReflectedMethod { + get { + if (_FromReflectedMethod == null) + _FromReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _FromReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID _FromReflectedField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID FromReflectedField { + get { + if (_FromReflectedField == null) + _FromReflectedField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID)); + return _FromReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference _ToReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference ToReflectedMethod { + get { + if (_ToReflectedMethod == null) + _ToReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool_JniLocalReference)); + return _ToReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _GetSuperclass; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference GetSuperclass { + get { + if (_GetSuperclass == null) + _GetSuperclass = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _GetSuperclass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsAssignableFrom; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsAssignableFrom { + get { + if (_IsAssignableFrom == null) + _IsAssignableFrom = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsAssignableFrom; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference _ToReflectedField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference ToReflectedField { + get { + if (_ToReflectedField == null) + _ToReflectedField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool_JniLocalReference)); + return _ToReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _Throw; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int Throw { + get { + if (_Throw == null) + _Throw = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _Throw; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int _ThrowNew; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int ThrowNew { + get { + if (_ThrowNew == null) + _ThrowNew = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_int)); + return _ThrowNew; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniLocalReference _ExceptionOccurred; + public JniFunc_JniEnvironmentSafeHandle_JniLocalReference ExceptionOccurred { + get { + if (_ExceptionOccurred == null) + _ExceptionOccurred = (JniFunc_JniEnvironmentSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JniEnvironmentSafeHandle_JniLocalReference)); + return _ExceptionOccurred; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionDescribe; + public JniAction_JniEnvironmentSafeHandle ExceptionDescribe { + get { + if (_ExceptionDescribe == null) + _ExceptionDescribe = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionDescribe; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionClear; + public JniAction_JniEnvironmentSafeHandle ExceptionClear { + get { + if (_ExceptionClear == null) + _ExceptionClear = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionClear; + } + } + + JniAction_JniEnvironmentSafeHandle_string _FatalError; + public JniAction_JniEnvironmentSafeHandle_string FatalError { + get { + if (_FatalError == null) + _FatalError = (JniAction_JniEnvironmentSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JniEnvironmentSafeHandle_string)); + return _FatalError; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _PushLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_int_int PushLocalFrame { + get { + if (_PushLocalFrame == null) + _PushLocalFrame = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _PushLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _PopLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference PopLocalFrame { + get { + if (_PopLocalFrame == null) + _PopLocalFrame = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _PopLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference _NewGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference NewGlobalRef { + get { + if (_NewGlobalRef == null) + _NewGlobalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniGlobalReference)); + return _NewGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteGlobalRef { + get { + if (_DeleteGlobalRef == null) + _DeleteGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteLocalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteLocalRef { + get { + if (_DeleteLocalRef == null) + _DeleteLocalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsSameObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsSameObject { + get { + if (_IsSameObject == null) + _IsSameObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsSameObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _NewLocalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference NewLocalRef { + get { + if (_NewLocalRef == null) + _NewLocalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _NewLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _EnsureLocalCapacity; + public JniFunc_JniEnvironmentSafeHandle_int_int EnsureLocalCapacity { + get { + if (_EnsureLocalCapacity == null) + _EnsureLocalCapacity = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _EnsureLocalCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _AllocObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference AllocObject { + get { + if (_AllocObject == null) + _AllocObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _AllocObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _NewObject; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference NewObject { + get { + if (_NewObject == null) + _NewObject = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _NewObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _NewObjectA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference NewObjectA { + get { + if (_NewObjectA == null) + _NewObjectA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _NewObjectA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference _GetObjectClass; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference GetObjectClass { + get { + if (_GetObjectClass == null) + _GetObjectClass = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _GetObjectClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool _IsInstanceOf; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool IsInstanceOf { + get { + if (_IsInstanceOf == null) + _IsInstanceOf = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_bool)); + return _IsInstanceOf; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID _GetMethodID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID GetMethodID { + get { + if (_GetMethodID == null) + _GetMethodID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceMethodID)); + return _GetMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _CallObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference CallObjectMethod { + get { + if (_CallObjectMethod == null) + _CallObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _CallObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _CallObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference CallObjectMethodA { + get { + if (_CallObjectMethodA == null) + _CallObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _CallObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool _CallBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool CallBooleanMethod { + get { + if (_CallBooleanMethod == null) + _CallBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool)); + return _CallBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool _CallBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool CallBooleanMethodA { + get { + if (_CallBooleanMethodA == null) + _CallBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool)); + return _CallBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte _CallSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte CallSByteMethod { + get { + if (_CallSByteMethod == null) + _CallSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte)); + return _CallSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte _CallSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte CallSByteMethodA { + get { + if (_CallSByteMethodA == null) + _CallSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte)); + return _CallSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char _CallCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char CallCharMethod { + get { + if (_CallCharMethod == null) + _CallCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char)); + return _CallCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char _CallCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char CallCharMethodA { + get { + if (_CallCharMethodA == null) + _CallCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char)); + return _CallCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short _CallShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short CallShortMethod { + get { + if (_CallShortMethod == null) + _CallShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short)); + return _CallShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short _CallShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short CallShortMethodA { + get { + if (_CallShortMethodA == null) + _CallShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short)); + return _CallShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int _CallIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int CallIntMethod { + get { + if (_CallIntMethod == null) + _CallIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int)); + return _CallIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int _CallIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int CallIntMethodA { + get { + if (_CallIntMethodA == null) + _CallIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int)); + return _CallIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long _CallLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long CallLongMethod { + get { + if (_CallLongMethod == null) + _CallLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long)); + return _CallLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long _CallLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long CallLongMethodA { + get { + if (_CallLongMethodA == null) + _CallLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long)); + return _CallLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float _CallFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float CallFloatMethod { + get { + if (_CallFloatMethod == null) + _CallFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float)); + return _CallFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float _CallFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float CallFloatMethodA { + get { + if (_CallFloatMethodA == null) + _CallFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float)); + return _CallFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double _CallDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double CallDoubleMethod { + get { + if (_CallDoubleMethod == null) + _CallDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double)); + return _CallDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double _CallDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double CallDoubleMethodA { + get { + if (_CallDoubleMethodA == null) + _CallDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double)); + return _CallDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _CallVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID CallVoidMethod { + get { + if (_CallVoidMethod == null) + _CallVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _CallVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef _CallVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef CallVoidMethodA { + get { + if (_CallVoidMethodA == null) + _CallVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef)); + return _CallVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference _CallNonvirtualObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference CallNonvirtualObjectMethod { + get { + if (_CallNonvirtualObjectMethod == null) + _CallNonvirtualObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JniLocalReference)); + return _CallNonvirtualObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference _CallNonvirtualObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference CallNonvirtualObjectMethodA { + get { + if (_CallNonvirtualObjectMethodA == null) + _CallNonvirtualObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_JniLocalReference)); + return _CallNonvirtualObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool _CallNonvirtualBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool CallNonvirtualBooleanMethod { + get { + if (_CallNonvirtualBooleanMethod == null) + _CallNonvirtualBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_bool)); + return _CallNonvirtualBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool _CallNonvirtualBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool CallNonvirtualBooleanMethodA { + get { + if (_CallNonvirtualBooleanMethodA == null) + _CallNonvirtualBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_bool)); + return _CallNonvirtualBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte _CallNonvirtualSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte CallNonvirtualSByteMethod { + get { + if (_CallNonvirtualSByteMethod == null) + _CallNonvirtualSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_sbyte)); + return _CallNonvirtualSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte _CallNonvirtualSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte CallNonvirtualSByteMethodA { + get { + if (_CallNonvirtualSByteMethodA == null) + _CallNonvirtualSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_sbyte)); + return _CallNonvirtualSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char _CallNonvirtualCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char CallNonvirtualCharMethod { + get { + if (_CallNonvirtualCharMethod == null) + _CallNonvirtualCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_char)); + return _CallNonvirtualCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char _CallNonvirtualCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char CallNonvirtualCharMethodA { + get { + if (_CallNonvirtualCharMethodA == null) + _CallNonvirtualCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_char)); + return _CallNonvirtualCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short _CallNonvirtualShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short CallNonvirtualShortMethod { + get { + if (_CallNonvirtualShortMethod == null) + _CallNonvirtualShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_short)); + return _CallNonvirtualShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short _CallNonvirtualShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short CallNonvirtualShortMethodA { + get { + if (_CallNonvirtualShortMethodA == null) + _CallNonvirtualShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_short)); + return _CallNonvirtualShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int _CallNonvirtualIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int CallNonvirtualIntMethod { + get { + if (_CallNonvirtualIntMethod == null) + _CallNonvirtualIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_int)); + return _CallNonvirtualIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int _CallNonvirtualIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int CallNonvirtualIntMethodA { + get { + if (_CallNonvirtualIntMethodA == null) + _CallNonvirtualIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_int)); + return _CallNonvirtualIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long _CallNonvirtualLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long CallNonvirtualLongMethod { + get { + if (_CallNonvirtualLongMethod == null) + _CallNonvirtualLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_long)); + return _CallNonvirtualLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long _CallNonvirtualLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long CallNonvirtualLongMethodA { + get { + if (_CallNonvirtualLongMethodA == null) + _CallNonvirtualLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_long)); + return _CallNonvirtualLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float _CallNonvirtualFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float CallNonvirtualFloatMethod { + get { + if (_CallNonvirtualFloatMethod == null) + _CallNonvirtualFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_float)); + return _CallNonvirtualFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float _CallNonvirtualFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float CallNonvirtualFloatMethodA { + get { + if (_CallNonvirtualFloatMethodA == null) + _CallNonvirtualFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_float)); + return _CallNonvirtualFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double _CallNonvirtualDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double CallNonvirtualDoubleMethod { + get { + if (_CallNonvirtualDoubleMethod == null) + _CallNonvirtualDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_double)); + return _CallNonvirtualDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double _CallNonvirtualDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double CallNonvirtualDoubleMethodA { + get { + if (_CallNonvirtualDoubleMethodA == null) + _CallNonvirtualDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef_double)); + return _CallNonvirtualDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID _CallNonvirtualVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID CallNonvirtualVoidMethod { + get { + if (_CallNonvirtualVoidMethod == null) + _CallNonvirtualVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID)); + return _CallNonvirtualVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef _CallNonvirtualVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef CallNonvirtualVoidMethodA { + get { + if (_CallNonvirtualVoidMethodA == null) + _CallNonvirtualVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniReferenceSafeHandle_JniInstanceMethodID_JValueRef)); + return _CallNonvirtualVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID _GetFieldID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID GetFieldID { + get { + if (_GetFieldID == null) + _GetFieldID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniInstanceFieldID)); + return _GetFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference _GetObjectField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference GetObjectField { + get { + if (_GetObjectField == null) + _GetObjectField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniLocalReference)); + return _GetObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool _GetBooleanField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool GetBooleanField { + get { + if (_GetBooleanField == null) + _GetBooleanField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool)); + return _GetBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte _GetByteField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte GetByteField { + get { + if (_GetByteField == null) + _GetByteField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte)); + return _GetByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char _GetCharField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char GetCharField { + get { + if (_GetCharField == null) + _GetCharField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char)); + return _GetCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short _GetShortField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short GetShortField { + get { + if (_GetShortField == null) + _GetShortField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short)); + return _GetShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int _GetIntField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int GetIntField { + get { + if (_GetIntField == null) + _GetIntField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int)); + return _GetIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long _GetLongField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long GetLongField { + get { + if (_GetLongField == null) + _GetLongField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long)); + return _GetLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float _GetFloatField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float GetFloatField { + get { + if (_GetFloatField == null) + _GetFloatField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float)); + return _GetFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double _GetDoubleField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double GetDoubleField { + get { + if (_GetDoubleField == null) + _GetDoubleField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double)); + return _GetDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle _SetObjectField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle SetObjectField { + get { + if (_SetObjectField == null) + _SetObjectField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_JniReferenceSafeHandle)); + return _SetObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool _SetBooleanField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool SetBooleanField { + get { + if (_SetBooleanField == null) + _SetBooleanField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_bool)); + return _SetBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte _SetByteField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte SetByteField { + get { + if (_SetByteField == null) + _SetByteField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_sbyte)); + return _SetByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char _SetCharField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char SetCharField { + get { + if (_SetCharField == null) + _SetCharField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_char)); + return _SetCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short _SetShortField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short SetShortField { + get { + if (_SetShortField == null) + _SetShortField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_short)); + return _SetShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int _SetIntField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int SetIntField { + get { + if (_SetIntField == null) + _SetIntField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_int)); + return _SetIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long _SetLongField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long SetLongField { + get { + if (_SetLongField == null) + _SetLongField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_long)); + return _SetLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float _SetFloatField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float SetFloatField { + get { + if (_SetFloatField == null) + _SetFloatField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_float)); + return _SetFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double _SetDoubleField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double SetDoubleField { + get { + if (_SetDoubleField == null) + _SetDoubleField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniInstanceFieldID_double)); + return _SetDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID _GetStaticMethodID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID GetStaticMethodID { + get { + if (_GetStaticMethodID == null) + _GetStaticMethodID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticMethodID)); + return _GetStaticMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference _CallStaticObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference CallStaticObjectMethod { + get { + if (_CallStaticObjectMethod == null) + _CallStaticObjectMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JniLocalReference)); + return _CallStaticObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference _CallStaticObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference CallStaticObjectMethodA { + get { + if (_CallStaticObjectMethodA == null) + _CallStaticObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_JniLocalReference)); + return _CallStaticObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool _CallStaticBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool CallStaticBooleanMethod { + get { + if (_CallStaticBooleanMethod == null) + _CallStaticBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_bool)); + return _CallStaticBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool _CallStaticBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool CallStaticBooleanMethodA { + get { + if (_CallStaticBooleanMethodA == null) + _CallStaticBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_bool)); + return _CallStaticBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte _CallStaticSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte CallStaticSByteMethod { + get { + if (_CallStaticSByteMethod == null) + _CallStaticSByteMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_sbyte)); + return _CallStaticSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte _CallStaticSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte CallStaticSByteMethodA { + get { + if (_CallStaticSByteMethodA == null) + _CallStaticSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_sbyte)); + return _CallStaticSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char _CallStaticCharMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char CallStaticCharMethod { + get { + if (_CallStaticCharMethod == null) + _CallStaticCharMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_char)); + return _CallStaticCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char _CallStaticCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char CallStaticCharMethodA { + get { + if (_CallStaticCharMethodA == null) + _CallStaticCharMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_char)); + return _CallStaticCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short _CallStaticShortMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short CallStaticShortMethod { + get { + if (_CallStaticShortMethod == null) + _CallStaticShortMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_short)); + return _CallStaticShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short _CallStaticShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short CallStaticShortMethodA { + get { + if (_CallStaticShortMethodA == null) + _CallStaticShortMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_short)); + return _CallStaticShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int _CallStaticIntMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int CallStaticIntMethod { + get { + if (_CallStaticIntMethod == null) + _CallStaticIntMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_int)); + return _CallStaticIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int _CallStaticIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int CallStaticIntMethodA { + get { + if (_CallStaticIntMethodA == null) + _CallStaticIntMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_int)); + return _CallStaticIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long _CallStaticLongMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long CallStaticLongMethod { + get { + if (_CallStaticLongMethod == null) + _CallStaticLongMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_long)); + return _CallStaticLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long _CallStaticLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long CallStaticLongMethodA { + get { + if (_CallStaticLongMethodA == null) + _CallStaticLongMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_long)); + return _CallStaticLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float _CallStaticFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float CallStaticFloatMethod { + get { + if (_CallStaticFloatMethod == null) + _CallStaticFloatMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_float)); + return _CallStaticFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float _CallStaticFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float CallStaticFloatMethodA { + get { + if (_CallStaticFloatMethodA == null) + _CallStaticFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_float)); + return _CallStaticFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double _CallStaticDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double CallStaticDoubleMethod { + get { + if (_CallStaticDoubleMethod == null) + _CallStaticDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_double)); + return _CallStaticDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double _CallStaticDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double CallStaticDoubleMethodA { + get { + if (_CallStaticDoubleMethodA == null) + _CallStaticDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef_double)); + return _CallStaticDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID _CallStaticVoidMethod; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID CallStaticVoidMethod { + get { + if (_CallStaticVoidMethod == null) + _CallStaticVoidMethod = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID)); + return _CallStaticVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef _CallStaticVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef CallStaticVoidMethodA { + get { + if (_CallStaticVoidMethodA == null) + _CallStaticVoidMethodA = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticMethodID_JValueRef)); + return _CallStaticVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID _GetStaticFieldID; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID GetStaticFieldID { + get { + if (_GetStaticFieldID == null) + _GetStaticFieldID = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string_string_JniStaticFieldID)); + return _GetStaticFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference _GetStaticObjectField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference GetStaticObjectField { + get { + if (_GetStaticObjectField == null) + _GetStaticObjectField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniLocalReference)); + return _GetStaticObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool _GetStaticBooleanField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool GetStaticBooleanField { + get { + if (_GetStaticBooleanField == null) + _GetStaticBooleanField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool)); + return _GetStaticBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte _GetStaticByteField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte GetStaticByteField { + get { + if (_GetStaticByteField == null) + _GetStaticByteField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte)); + return _GetStaticByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char _GetStaticCharField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char GetStaticCharField { + get { + if (_GetStaticCharField == null) + _GetStaticCharField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char)); + return _GetStaticCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short _GetStaticShortField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short GetStaticShortField { + get { + if (_GetStaticShortField == null) + _GetStaticShortField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short)); + return _GetStaticShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int _GetStaticIntField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int GetStaticIntField { + get { + if (_GetStaticIntField == null) + _GetStaticIntField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int)); + return _GetStaticIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long _GetStaticLongField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long GetStaticLongField { + get { + if (_GetStaticLongField == null) + _GetStaticLongField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long)); + return _GetStaticLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float _GetStaticFloatField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float GetStaticFloatField { + get { + if (_GetStaticFloatField == null) + _GetStaticFloatField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float)); + return _GetStaticFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double _GetStaticDoubleField; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double GetStaticDoubleField { + get { + if (_GetStaticDoubleField == null) + _GetStaticDoubleField = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double)); + return _GetStaticDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle _SetStaticObjectField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle SetStaticObjectField { + get { + if (_SetStaticObjectField == null) + _SetStaticObjectField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_JniReferenceSafeHandle)); + return _SetStaticObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool _SetStaticBooleanField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool SetStaticBooleanField { + get { + if (_SetStaticBooleanField == null) + _SetStaticBooleanField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_bool)); + return _SetStaticBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte _SetStaticByteField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte SetStaticByteField { + get { + if (_SetStaticByteField == null) + _SetStaticByteField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_sbyte)); + return _SetStaticByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char _SetStaticCharField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char SetStaticCharField { + get { + if (_SetStaticCharField == null) + _SetStaticCharField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_char)); + return _SetStaticCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short _SetStaticShortField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short SetStaticShortField { + get { + if (_SetStaticShortField == null) + _SetStaticShortField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_short)); + return _SetStaticShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int _SetStaticIntField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int SetStaticIntField { + get { + if (_SetStaticIntField == null) + _SetStaticIntField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_int)); + return _SetStaticIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long _SetStaticLongField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long SetStaticLongField { + get { + if (_SetStaticLongField == null) + _SetStaticLongField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_long)); + return _SetStaticLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float _SetStaticFloatField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float SetStaticFloatField { + get { + if (_SetStaticFloatField == null) + _SetStaticFloatField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_float)); + return _SetStaticFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double _SetStaticDoubleField; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double SetStaticDoubleField { + get { + if (_SetStaticDoubleField == null) + _SetStaticDoubleField = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniStaticFieldID_double)); + return _SetStaticDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference _NewString; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference NewString { + get { + if (_NewString == null) + _NewString = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_JniLocalReference)); + return _NewString; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetStringLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetStringLength { + get { + if (_GetStringLength == null) + _GetStringLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetStringLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetStringChars; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetStringChars { + get { + if (_GetStringChars == null) + _GetStringChars = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetStringChars; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr _ReleaseStringChars; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr ReleaseStringChars { + get { + if (_ReleaseStringChars == null) + _ReleaseStringChars = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr)); + return _ReleaseStringChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference _NewStringUTF; + public JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference NewStringUTF { + get { + if (_NewStringUTF == null) + _NewStringUTF = (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JniEnvironmentSafeHandle_string_JniLocalReference)); + return _NewStringUTF; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetStringUTFLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetStringUTFLength { + get { + if (_GetStringUTFLength == null) + _GetStringUTFLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetStringUTFLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string _GetStringUTFChars; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string GetStringUTFChars { + get { + if (_GetStringUTFChars == null) + _GetStringUTFChars = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string)); + return _GetStringUTFChars; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string _ReleaseStringUTFChars; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string ReleaseStringUTFChars { + get { + if (_ReleaseStringUTFChars == null) + _ReleaseStringUTFChars = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string)); + return _ReleaseStringUTFChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _GetArrayLength; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int GetArrayLength { + get { + if (_GetArrayLength == null) + _GetArrayLength = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _GetArrayLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference _NewObjectArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference NewObjectArray { + get { + if (_NewObjectArray == null) + _NewObjectArray = (JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniReferenceSafeHandle_JniReferenceSafeHandle_JniLocalReference)); + return _NewObjectArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference _GetObjectArrayElement; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference GetObjectArrayElement { + get { + if (_GetObjectArrayElement == null) + _GetObjectArrayElement = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniLocalReference)); + return _GetObjectArrayElement; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle _SetObjectArrayElement; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle SetObjectArrayElement { + get { + if (_SetObjectArrayElement == null) + _SetObjectArrayElement = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_JniReferenceSafeHandle)); + return _SetObjectArrayElement; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewBooleanArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewBooleanArray { + get { + if (_NewBooleanArray == null) + _NewBooleanArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewBooleanArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewByteArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewByteArray { + get { + if (_NewByteArray == null) + _NewByteArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewByteArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewCharArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewCharArray { + get { + if (_NewCharArray == null) + _NewCharArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewCharArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewShortArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewShortArray { + get { + if (_NewShortArray == null) + _NewShortArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewShortArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewIntArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewIntArray { + get { + if (_NewIntArray == null) + _NewIntArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewIntArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewLongArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewLongArray { + get { + if (_NewLongArray == null) + _NewLongArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewLongArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewFloatArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewFloatArray { + get { + if (_NewFloatArray == null) + _NewFloatArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewFloatArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference _NewDoubleArray; + public JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference NewDoubleArray { + get { + if (_NewDoubleArray == null) + _NewDoubleArray = (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_JniLocalReference)); + return _NewDoubleArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetBooleanArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetBooleanArrayElements { + get { + if (_GetBooleanArrayElements == null) + _GetBooleanArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetBooleanArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetByteArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetByteArrayElements { + get { + if (_GetByteArrayElements == null) + _GetByteArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetByteArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetCharArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetCharArrayElements { + get { + if (_GetCharArrayElements == null) + _GetCharArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetCharArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetShortArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetShortArrayElements { + get { + if (_GetShortArrayElements == null) + _GetShortArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetShortArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetIntArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetIntArrayElements { + get { + if (_GetIntArrayElements == null) + _GetIntArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetIntArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetLongArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetLongArrayElements { + get { + if (_GetLongArrayElements == null) + _GetLongArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetLongArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetFloatArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetFloatArrayElements { + get { + if (_GetFloatArrayElements == null) + _GetFloatArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetFloatArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetDoubleArrayElements; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetDoubleArrayElements { + get { + if (_GetDoubleArrayElements == null) + _GetDoubleArrayElements = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseBooleanArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseBooleanArrayElements { + get { + if (_ReleaseBooleanArrayElements == null) + _ReleaseBooleanArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseBooleanArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseByteArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseByteArrayElements { + get { + if (_ReleaseByteArrayElements == null) + _ReleaseByteArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseByteArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseCharArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseCharArrayElements { + get { + if (_ReleaseCharArrayElements == null) + _ReleaseCharArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseCharArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseShortArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseShortArrayElements { + get { + if (_ReleaseShortArrayElements == null) + _ReleaseShortArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseShortArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseIntArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseIntArrayElements { + get { + if (_ReleaseIntArrayElements == null) + _ReleaseIntArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseIntArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseLongArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseLongArrayElements { + get { + if (_ReleaseLongArrayElements == null) + _ReleaseLongArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseLongArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseFloatArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseFloatArrayElements { + get { + if (_ReleaseFloatArrayElements == null) + _ReleaseFloatArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseFloatArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleaseDoubleArrayElements; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleaseDoubleArrayElements { + get { + if (_ReleaseDoubleArrayElements == null) + _ReleaseDoubleArrayElements = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleaseDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetBooleanArrayRegion { + get { + if (_GetBooleanArrayRegion == null) + _GetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetByteArrayRegion { + get { + if (_GetByteArrayRegion == null) + _GetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetCharArrayRegion { + get { + if (_GetCharArrayRegion == null) + _GetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetShortArrayRegion { + get { + if (_GetShortArrayRegion == null) + _GetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetIntArrayRegion { + get { + if (_GetIntArrayRegion == null) + _GetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetLongArrayRegion { + get { + if (_GetLongArrayRegion == null) + _GetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetFloatArrayRegion { + get { + if (_GetFloatArrayRegion == null) + _GetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetDoubleArrayRegion { + get { + if (_GetDoubleArrayRegion == null) + _GetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetDoubleArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetBooleanArrayRegion { + get { + if (_SetBooleanArrayRegion == null) + _SetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetByteArrayRegion { + get { + if (_SetByteArrayRegion == null) + _SetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetCharArrayRegion { + get { + if (_SetCharArrayRegion == null) + _SetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetShortArrayRegion { + get { + if (_SetShortArrayRegion == null) + _SetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetIntArrayRegion { + get { + if (_SetIntArrayRegion == null) + _SetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetLongArrayRegion { + get { + if (_SetLongArrayRegion == null) + _SetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetFloatArrayRegion { + get { + if (_SetFloatArrayRegion == null) + _SetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _SetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr SetDoubleArrayRegion { + get { + if (_SetDoubleArrayRegion == null) + _SetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _SetDoubleArrayRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int _RegisterNatives; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int RegisterNatives { + get { + if (_RegisterNatives == null) + _RegisterNatives = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniNativeMethodRegistrationArray_int_int)); + return _RegisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _UnregisterNatives; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int UnregisterNatives { + get { + if (_UnregisterNatives == null) + _UnregisterNatives = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _UnregisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _MonitorEnter; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int MonitorEnter { + get { + if (_MonitorEnter == null) + _MonitorEnter = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _MonitorEnter; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int _MonitorExit; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int MonitorExit { + get { + if (_MonitorExit == null) + _MonitorExit = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int)); + return _MonitorExit; + } + } + + JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int _GetJavaVM; + public JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int GetJavaVM { + get { + if (_GetJavaVM == null) + _GetJavaVM = (JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JniEnvironmentSafeHandle_outJavaVMSafeHandle_int)); + return _GetJavaVM; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetStringRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetStringRegion { + get { + if (_GetStringRegion == null) + _GetStringRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetStringRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr _GetStringUTFRegion; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr GetStringUTFRegion { + get { + if (_GetStringUTFRegion == null) + _GetStringUTFRegion = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_int_int_IntPtr)); + return _GetStringUTFRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr _GetPrimitiveArrayCritical; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr GetPrimitiveArrayCritical { + get { + if (_GetPrimitiveArrayCritical == null) + _GetPrimitiveArrayCritical = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_IntPtr)); + return _GetPrimitiveArrayCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int _ReleasePrimitiveArrayCritical; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int ReleasePrimitiveArrayCritical { + get { + if (_ReleasePrimitiveArrayCritical == null) + _ReleasePrimitiveArrayCritical = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_int)); + return _ReleasePrimitiveArrayCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string _GetStringCritical; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string GetStringCritical { + get { + if (_GetStringCritical == null) + _GetStringCritical = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr_string)); + return _GetStringCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string _ReleaseStringCritical; + public JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string ReleaseStringCritical { + get { + if (_ReleaseStringCritical == null) + _ReleaseStringCritical = (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JniEnvironmentSafeHandle_JniReferenceSafeHandle_string)); + return _ReleaseStringCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference _NewWeakGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference NewWeakGlobalRef { + get { + if (_NewWeakGlobalRef == null) + _NewWeakGlobalRef = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniWeakGlobalReference)); + return _NewWeakGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteWeakGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteWeakGlobalRef { + get { + if (_DeleteWeakGlobalRef == null) + _DeleteWeakGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteWeakGlobalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_bool _ExceptionCheck; + public JniFunc_JniEnvironmentSafeHandle_bool ExceptionCheck { + get { + if (_ExceptionCheck == null) + _ExceptionCheck = (JniFunc_JniEnvironmentSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JniEnvironmentSafeHandle_bool)); + return _ExceptionCheck; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference _NewDirectByteBuffer; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference NewDirectByteBuffer { + get { + if (_NewDirectByteBuffer == null) + _NewDirectByteBuffer = (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_JniLocalReference)); + return _NewDirectByteBuffer; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr _GetDirectBufferAddress; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr GetDirectBufferAddress { + get { + if (_GetDirectBufferAddress == null) + _GetDirectBufferAddress = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_IntPtr)); + return _GetDirectBufferAddress; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long _GetDirectBufferCapacity; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long GetDirectBufferCapacity { + get { + if (_GetDirectBufferCapacity == null) + _GetDirectBufferCapacity = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_long)); + return _GetDirectBufferCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType _GetObjectRefType; + public JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType GetObjectRefType { + get { + if (_GetObjectRefType == null) + _GetObjectRefType = (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JniEnvironmentSafeHandle_JniReferenceSafeHandle_JniObjectReferenceType)); + return _GetObjectRefType; + } + } + } +} +#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES +#if FEATURE_HANDLES_ARE_INTPTRS +namespace +#if _NAMESPACE_PER_HANDLE + Java.Interop.IntPtrs +#else + Java.Interop +#endif +{ + + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int (JNIEnvPtr env); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_string_jobject_IntPtr_int_jobject (JNIEnvPtr env, string name, jobject loader, IntPtr buf, int bufLen); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_string_jobject (JNIEnvPtr env, string classname); + unsafe delegate jinstanceMethodID JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID (JNIEnvPtr env, jobject method); + unsafe delegate jinstanceFieldID JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID (JNIEnvPtr env, jobject field); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool_jobject (JNIEnvPtr env, jobject cls, jinstanceMethodID jmethod, bool isStatic); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jobject (JNIEnvPtr env, jobject jclass); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool (JNIEnvPtr env, jobject clazz1, jobject clazz2); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool_jobject (JNIEnvPtr env, jobject cls, jinstanceFieldID jfieldID, bool isStatic); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_int (JNIEnvPtr env, jobject obj); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_string_int (JNIEnvPtr env, jobject clazz, string message); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject (JNIEnvPtr env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle (JNIEnvPtr env); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_string (JNIEnvPtr env, string msg); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_int_int (JNIEnvPtr env, int capacity); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_IntPtr (JNIEnvPtr env, IntPtr jobject); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject (JNIEnvPtr env, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject (JNIEnvPtr env, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jinstanceMethodID JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceMethodID (JNIEnvPtr env, jobject kls, string name, string signature); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_bool (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_sbyte (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_sbyte (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_char (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_char (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_short (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_short (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_int (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_int (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_long (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_long (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_float (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_float (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_double (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_double (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef (JNIEnvPtr env, jobject jobject, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_jobject (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_jobject (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_bool (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_bool (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_sbyte (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_sbyte (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_char (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_char (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_short (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_short (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_int (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_int (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_long (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_long (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_float (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_float (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_double (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_double (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef (JNIEnvPtr env, jobject jobject, jobject jclass, jinstanceMethodID jmethod, JValue* parms); + unsafe delegate jinstanceFieldID JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceFieldID (JNIEnvPtr env, jobject jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, jobject val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double (JNIEnvPtr env, jobject jobject, jinstanceFieldID jfieldID, double val); + unsafe delegate jstaticMethodID JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticMethodID (JNIEnvPtr env, jobject jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_jobject (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_jobject (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_bool (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_bool (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_sbyte (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_sbyte (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_char (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_char (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_short (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_short (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_int (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_int (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_long (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_long (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_float (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_float (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_double (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_double (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef (JNIEnvPtr env, jobject jclass, jstaticMethodID jmethod, JValue* parms); + unsafe delegate jstaticFieldID JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticFieldID (JNIEnvPtr env, jobject jclass, string name, string sig); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate sbyte JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate char JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate short JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate float JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate double JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, jobject val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, bool val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, sbyte val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, char val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, short val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, int val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, long val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, float val); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double (JNIEnvPtr env, jobject jclass, jstaticFieldID jfieldID, double val); + [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl, CharSet=CharSet.Unicode)] + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject (JNIEnvPtr env, IntPtr unicodeChars, int len); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr (JNIEnvPtr env, jobject @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_IntPtr (JNIEnvPtr env, jobject @string, IntPtr chars); + unsafe delegate string JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string (JNIEnvPtr env, jobject @string, IntPtr isCopy); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_string (JNIEnvPtr env, jobject @string, string utf); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_int_jobject_jobject_jobject (JNIEnvPtr env, int length, jobject elementClass, jobject initialElement); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_jobject_int_jobject (JNIEnvPtr env, jobject array, int index); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_int_jobject (JNIEnvPtr env, jobject array, int index, jobject value); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_int_jobject (JNIEnvPtr env, int length); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int (JNIEnvPtr env, jobject array, IntPtr elems, int mode); + unsafe delegate void JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr (JNIEnvPtr env, jobject array, int start, int len, IntPtr buf); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_jobject_JniNativeMethodRegistrationArray_int_int (JNIEnvPtr env, jobject jclass, JniNativeMethodRegistration [] methods, int nMethods); + unsafe delegate int JniFunc_JniEnvironmentSafeHandle_outIntPtr_int (JNIEnvPtr env, out IntPtr vm); + unsafe delegate bool JniFunc_JniEnvironmentSafeHandle_bool (JNIEnvPtr env); + unsafe delegate jobject JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject (JNIEnvPtr env, IntPtr address, long capacity); + unsafe delegate IntPtr JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr (JNIEnvPtr env, jobject buf); + unsafe delegate long JniFunc_JniEnvironmentSafeHandle_jobject_long (JNIEnvPtr env, jobject buf); + unsafe delegate JniObjectReferenceType JniFunc_JniEnvironmentSafeHandle_jobject_JniObjectReferenceType (JNIEnvPtr env, jobject jobject); + + partial class JniEnvironment { + + internal static partial class Activator { + + public static unsafe JniObjectReference AllocObject (JniObjectReference jclass) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.AllocObject (JniEnvironment.Current.SafeHandle, jclass.Handle); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewObject (JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObject (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewObject (JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + } + + public static partial class Arrays { + + public static unsafe int GetArrayLength (JniObjectReference array_ptr) + { + if (array_ptr.Handle == IntPtr.Zero) + throw new ArgumentException ("`array_ptr` must not be IntPtr.Zero.", "array_ptr"); + + var tmp = JniEnvironment.Current.Invoker.GetArrayLength (JniEnvironment.Current.SafeHandle, array_ptr.Handle); + return tmp; + } + + public static unsafe JniObjectReference NewObjectArray (int length, JniObjectReference elementClass, JniObjectReference initialElement) + { + if (elementClass.Handle == IntPtr.Zero) + throw new ArgumentException ("`elementClass` must not be IntPtr.Zero.", "elementClass"); + + var tmp = JniEnvironment.Current.Invoker.NewObjectArray (JniEnvironment.Current.SafeHandle, length, elementClass.Handle, initialElement.Handle); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference GetObjectArrayElement (JniObjectReference array, int index) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectArrayElement (JniEnvironment.Current.SafeHandle, array.Handle, index); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe void SetObjectArrayElement (JniObjectReference array, int index, JniObjectReference value) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + JniEnvironment.Current.Invoker.SetObjectArrayElement (JniEnvironment.Current.SafeHandle, array.Handle, index, value.Handle); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe JniObjectReference NewBooleanArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewBooleanArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewByteArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewByteArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewCharArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewCharArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewShortArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewShortArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewIntArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewIntArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewLongArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewLongArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewFloatArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewFloatArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference NewDoubleArray (int length) + { + var tmp = JniEnvironment.Current.Invoker.NewDoubleArray (JniEnvironment.Current.SafeHandle, length); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe IntPtr GetBooleanArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetByteArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetByteArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetCharArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetCharArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetShortArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetShortArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetIntArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetIntArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetLongArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetLongArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetFloatArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe IntPtr GetDoubleArrayElements (JniObjectReference array, IntPtr isCopy) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, isCopy); + return tmp; + } + + public static unsafe void ReleaseBooleanArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseBooleanArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseByteArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseByteArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseCharArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseCharArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseShortArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseShortArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseIntArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseIntArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseLongArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseLongArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseFloatArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseFloatArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + public static unsafe void ReleaseDoubleArrayElements (JniObjectReference array, IntPtr elems, int mode) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (elems == IntPtr.Zero) + throw new ArgumentException ("'elems' must not be IntPtr.Zero.", "elems"); + + JniEnvironment.Current.Invoker.ReleaseDoubleArrayElements (JniEnvironment.Current.SafeHandle, array.Handle, elems, mode); + } + + internal static unsafe void GetBooleanArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetByteArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetByteArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetCharArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetCharArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetShortArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetShortArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetIntArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetIntArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetLongArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetLongArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetFloatArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void GetDoubleArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.GetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void SetBooleanArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetBooleanArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetByteArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetByteArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetCharArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetCharArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetShortArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetShortArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetIntArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetIntArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetLongArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetLongArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetFloatArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetFloatArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe void SetDoubleArrayRegion (JniObjectReference array, int start, int len, IntPtr buf) + { + if (array.Handle == IntPtr.Zero) + throw new ArgumentException ("`array` must not be IntPtr.Zero.", "array"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + JniEnvironment.Current.Invoker.SetDoubleArrayRegion (JniEnvironment.Current.SafeHandle, array.Handle, start, len, buf); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + } + + public static partial class Errors { + + public static unsafe int Throw (JniObjectReference obj) + { + if (obj.Handle == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.Throw (JniEnvironment.Current.SafeHandle, obj.Handle); + return tmp; + } + + public static unsafe int ThrowNew (JniObjectReference clazz, string message) + { + if (clazz.Handle == IntPtr.Zero) + throw new ArgumentException ("`clazz` must not be IntPtr.Zero.", "clazz"); + if (message == null) + throw new ArgumentNullException ("message"); + + var tmp = JniEnvironment.Current.Invoker.ThrowNew (JniEnvironment.Current.SafeHandle, clazz.Handle, message); + return tmp; + } + + internal static unsafe JniObjectReference ExceptionOccurred () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionOccurred (JniEnvironment.Current.SafeHandle); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe void ExceptionDescribe () + { + JniEnvironment.Current.Invoker.ExceptionDescribe (JniEnvironment.Current.SafeHandle); + } + + internal static unsafe void ExceptionClear () + { + JniEnvironment.Current.Invoker.ExceptionClear (JniEnvironment.Current.SafeHandle); + } + + public static unsafe void FatalError (string msg) + { + if (msg == null) + throw new ArgumentNullException ("msg"); + + JniEnvironment.Current.Invoker.FatalError (JniEnvironment.Current.SafeHandle, msg); + } + + internal static unsafe bool ExceptionCheck () + { + var tmp = JniEnvironment.Current.Invoker.ExceptionCheck (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + + public static partial class Handles { + + public static unsafe int PushLocalFrame (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.PushLocalFrame (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe JniObjectReference PopLocalFrame (JniObjectReference result) + { + var tmp = JniEnvironment.Current.Invoker.PopLocalFrame (JniEnvironment.Current.SafeHandle, result.Handle); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe JniObjectReference NewGlobalRef (JniObjectReference jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewGlobalRef (JniEnvironment.Current.SafeHandle, jobject.Handle); + return new JniObjectReference (tmp, JniObjectReferenceType.Global); + } + + internal static unsafe void DeleteGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe void DeleteLocalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteLocalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniObjectReference NewLocalRef (JniObjectReference jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewLocalRef (JniEnvironment.Current.SafeHandle, jobject.Handle); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe int EnsureLocalCapacity (int capacity) + { + var tmp = JniEnvironment.Current.Invoker.EnsureLocalCapacity (JniEnvironment.Current.SafeHandle, capacity); + return tmp; + } + + public static unsafe int GetJavaVM (out IntPtr vm) + { + var tmp = JniEnvironment.Current.Invoker.GetJavaVM (JniEnvironment.Current.SafeHandle, out vm); + return tmp; + } + + internal static unsafe JniObjectReference NewWeakGlobalRef (JniObjectReference jobject) + { + var tmp = JniEnvironment.Current.Invoker.NewWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject.Handle); + return new JniObjectReference (tmp, JniObjectReferenceType.WeakGlobal); + } + + internal static unsafe void DeleteWeakGlobalRef (IntPtr jobject) + { + JniEnvironment.Current.Invoker.DeleteWeakGlobalRef (JniEnvironment.Current.SafeHandle, jobject); + } + + internal static unsafe JniObjectReferenceType GetObjectRefType (JniObjectReference jobject) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectRefType (JniEnvironment.Current.SafeHandle, jobject.Handle); + return tmp; + } + } + + public static partial class IO { + + public static unsafe JniObjectReference NewDirectByteBuffer (IntPtr address, long capacity) + { + if (address == IntPtr.Zero) + throw new ArgumentException ("'address' must not be IntPtr.Zero.", "address"); + + var tmp = JniEnvironment.Current.Invoker.NewDirectByteBuffer (JniEnvironment.Current.SafeHandle, address, capacity); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe IntPtr GetDirectBufferAddress (JniObjectReference buf) + { + if (buf.Handle == IntPtr.Zero) + throw new ArgumentException ("`buf` must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferAddress (JniEnvironment.Current.SafeHandle, buf.Handle); + return tmp; + } + + public static unsafe long GetDirectBufferCapacity (JniObjectReference buf) + { + if (buf.Handle == IntPtr.Zero) + throw new ArgumentException ("`buf` must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.GetDirectBufferCapacity (JniEnvironment.Current.SafeHandle, buf.Handle); + return tmp; + } + } + + internal static partial class Members { + + internal static unsafe JniObjectReference ToReflectedMethod (JniObjectReference cls, jinstanceMethodID jmethod, bool isStatic) + { + if (cls.Handle == IntPtr.Zero) + throw new ArgumentException ("`cls` must not be IntPtr.Zero.", "cls"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedMethod (JniEnvironment.Current.SafeHandle, cls.Handle, jmethod, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe JniObjectReference ToReflectedField (JniObjectReference cls, jinstanceFieldID jfieldID, bool isStatic) + { + if (cls.Handle == IntPtr.Zero) + throw new ArgumentException ("`cls` must not be IntPtr.Zero.", "cls"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.ToReflectedField (JniEnvironment.Current.SafeHandle, cls.Handle, jfieldID, isStatic); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe jinstanceMethodID GetMethodID (JniObjectReference kls, string name, string signature) + { + if (kls.Handle == IntPtr.Zero) + throw new ArgumentException ("`kls` must not be IntPtr.Zero.", "kls"); + if (name == null) + throw new ArgumentNullException ("name"); + if (signature == null) + throw new ArgumentNullException ("signature"); + + var tmp = JniEnvironment.Current.Invoker.GetMethodID (JniEnvironment.Current.SafeHandle, kls.Handle, name, signature); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniObjectReference CallObjectMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe JniObjectReference CallObjectMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallObjectMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe bool CallBooleanMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallBooleanMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallSByteMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallSByteMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallCharMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallCharMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallShortMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallShortMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallIntMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallIntMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallLongMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallLongMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallFloatMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallFloatMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallDoubleMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallVoidMethod (JniObjectReference jobject, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallVoidMethod (JniObjectReference jobject, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallVoidMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe JniObjectReference CallNonvirtualObjectMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualObjectMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallNonvirtualBooleanMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualBooleanMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallNonvirtualSByteMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualSByteMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallNonvirtualCharMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualCharMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallNonvirtualShortMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualShortMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallNonvirtualIntMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualIntMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallNonvirtualLongMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualLongMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallNonvirtualFloatMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualFloatMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallNonvirtualDoubleMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallNonvirtualDoubleMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallNonvirtualVoidMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethod (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallNonvirtualVoidMethod (JniObjectReference jobject, JniObjectReference jclass, jinstanceMethodID jmethod, JValue* parms) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallNonvirtualVoidMethodA (JniEnvironment.Current.SafeHandle, jobject.Handle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe jinstanceFieldID GetFieldID (JniObjectReference jclass, string name, string sig) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetFieldID (JniEnvironment.Current.SafeHandle, jclass.Handle, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniObjectReference GetObjectField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe bool GetBooleanField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetBooleanField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetByteField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetByteField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe char GetCharField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetCharField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe short GetShortField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetShortField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe int GetIntField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetIntField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe long GetLongField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetLongField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe float GetFloatField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetFloatField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe double GetDoubleField (JniObjectReference jobject, jinstanceFieldID jfieldID) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetDoubleField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID); + return tmp; + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, JniObjectReference val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetObjectField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val.Handle); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, bool val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetBooleanField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, sbyte val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetByteField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, char val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetCharField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, short val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetShortField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, int val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetIntField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, long val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetLongField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, float val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetFloatField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + internal static unsafe void SetField (JniObjectReference jobject, jinstanceFieldID jfieldID, double val) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetDoubleField (JniEnvironment.Current.SafeHandle, jobject.Handle, jfieldID, val); + } + + public static unsafe jstaticMethodID GetStaticMethodID (JniObjectReference jclass, string name, string sig) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticMethodID (JniEnvironment.Current.SafeHandle, jclass.Handle, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe JniObjectReference CallStaticObjectMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticObjectMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe bool CallStaticBooleanMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe bool CallStaticBooleanMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticBooleanMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe sbyte CallStaticSByteMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticSByteMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe char CallStaticCharMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticCharMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe short CallStaticShortMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticShortMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int CallStaticIntMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticIntMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe long CallStaticLongMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticLongMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe float CallStaticFloatMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticFloatMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe double CallStaticDoubleMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + var tmp = JniEnvironment.Current.Invoker.CallStaticDoubleMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe void CallStaticVoidMethod (JniObjectReference jclass, jstaticMethodID jmethod) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethod (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + internal static unsafe void CallStaticVoidMethod (JniObjectReference jclass, jstaticMethodID jmethod, JValue* parms) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jmethod == IntPtr.Zero) + throw new ArgumentNullException ("jmethod"); + + JniEnvironment.Current.Invoker.CallStaticVoidMethodA (JniEnvironment.Current.SafeHandle, jclass.Handle, jmethod, parms); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + } + + public static unsafe jstaticFieldID GetStaticFieldID (JniObjectReference jclass, string name, string sig) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (name == null) + throw new ArgumentNullException ("name"); + if (sig == null) + throw new ArgumentNullException ("sig"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFieldID (JniEnvironment.Current.SafeHandle, jclass.Handle, name, sig); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe JniObjectReference GetStaticObjectField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe bool GetStaticBooleanField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe sbyte GetStaticByteField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticByteField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe char GetStaticCharField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticCharField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe short GetStaticShortField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticShortField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe int GetStaticIntField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticIntField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe long GetStaticLongField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticLongField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe float GetStaticFloatField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe double GetStaticDoubleField (JniObjectReference jclass, jstaticFieldID jfieldID) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + var tmp = JniEnvironment.Current.Invoker.GetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID); + return tmp; + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, JniObjectReference val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticObjectField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val.Handle); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, bool val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticBooleanField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, sbyte val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticByteField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, char val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticCharField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, short val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticShortField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, int val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticIntField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, long val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticLongField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, float val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticFloatField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + + internal static unsafe void SetStaticField (JniObjectReference jclass, jstaticFieldID jfieldID, double val) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + if (jfieldID == IntPtr.Zero) + throw new ArgumentNullException ("jfieldID"); + + JniEnvironment.Current.Invoker.SetStaticDoubleField (JniEnvironment.Current.SafeHandle, jclass.Handle, jfieldID, val); + } + } + + internal static partial class Monitors { + + public static unsafe int MonitorEnter (JniObjectReference obj) + { + if (obj.Handle == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorEnter (JniEnvironment.Current.SafeHandle, obj.Handle); + return tmp; + } + + public static unsafe int MonitorExit (JniObjectReference obj) + { + if (obj.Handle == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + + var tmp = JniEnvironment.Current.Invoker.MonitorExit (JniEnvironment.Current.SafeHandle, obj.Handle); + return tmp; + } + } + + public static partial class Strings { + + internal static unsafe JniObjectReference NewString (IntPtr unicodeChars, int len) + { + if (unicodeChars == IntPtr.Zero) + throw new ArgumentException ("'unicodeChars' must not be IntPtr.Zero.", "unicodeChars"); + + var tmp = JniEnvironment.Current.Invoker.NewString (JniEnvironment.Current.SafeHandle, unicodeChars, len); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + internal static unsafe int GetStringLength (JniObjectReference @string) + { + if (@string.Handle == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringLength (JniEnvironment.Current.SafeHandle, @string.Handle); + return tmp; + } + + internal static unsafe IntPtr GetStringChars (JniObjectReference @string, IntPtr isCopy) + { + if (@string.Handle == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + + var tmp = JniEnvironment.Current.Invoker.GetStringChars (JniEnvironment.Current.SafeHandle, @string.Handle, isCopy); + return tmp; + } + + internal static unsafe void ReleaseStringChars (JniObjectReference @string, IntPtr chars) + { + if (@string.Handle == IntPtr.Zero) + throw new ArgumentException ("`@string` must not be IntPtr.Zero.", "@string"); + if (chars == IntPtr.Zero) + throw new ArgumentException ("'chars' must not be IntPtr.Zero.", "chars"); + + JniEnvironment.Current.Invoker.ReleaseStringChars (JniEnvironment.Current.SafeHandle, @string.Handle, chars); + } + } + + public static partial class Types { + + internal static unsafe JniObjectReference DefineClass (string name, JniObjectReference loader, IntPtr buf, int bufLen) + { + if (name == null) + throw new ArgumentNullException ("name"); + if (loader.Handle == IntPtr.Zero) + throw new ArgumentException ("`loader` must not be IntPtr.Zero.", "loader"); + if (buf == IntPtr.Zero) + throw new ArgumentException ("'buf' must not be IntPtr.Zero.", "buf"); + + var tmp = JniEnvironment.Current.Invoker.DefineClass (JniEnvironment.Current.SafeHandle, name, loader.Handle, buf, bufLen); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference FindClass (string classname) + { + if (classname == null) + throw new ArgumentNullException ("classname"); + + var tmp = JniEnvironment.Current.Invoker.FindClass (JniEnvironment.Current.SafeHandle, classname); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe JniObjectReference GetSuperclass (JniObjectReference jclass) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.GetSuperclass (JniEnvironment.Current.SafeHandle, jclass.Handle); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe bool IsAssignableFrom (JniObjectReference clazz1, JniObjectReference clazz2) + { + if (clazz1.Handle == IntPtr.Zero) + throw new ArgumentException ("`clazz1` must not be IntPtr.Zero.", "clazz1"); + if (clazz2.Handle == IntPtr.Zero) + throw new ArgumentException ("`clazz2` must not be IntPtr.Zero.", "clazz2"); + + var tmp = JniEnvironment.Current.Invoker.IsAssignableFrom (JniEnvironment.Current.SafeHandle, clazz1.Handle, clazz2.Handle); + return tmp; + } + + public static unsafe bool IsSameObject (JniObjectReference ref1, JniObjectReference ref2) + { + var tmp = JniEnvironment.Current.Invoker.IsSameObject (JniEnvironment.Current.SafeHandle, ref1.Handle, ref2.Handle); + return tmp; + } + + public static unsafe JniObjectReference GetObjectClass (JniObjectReference jobject) + { + if (jobject.Handle == IntPtr.Zero) + throw new ArgumentException ("`jobject` must not be IntPtr.Zero.", "jobject"); + + var tmp = JniEnvironment.Current.Invoker.GetObjectClass (JniEnvironment.Current.SafeHandle, jobject.Handle); + JniEnvironment.Current.LogCreateLocalRef (tmp); + return new JniObjectReference (tmp, JniObjectReferenceType.Local); + } + + public static unsafe bool IsInstanceOf (JniObjectReference obj, JniObjectReference clazz) + { + if (obj.Handle == IntPtr.Zero) + throw new ArgumentException ("`obj` must not be IntPtr.Zero.", "obj"); + if (clazz.Handle == IntPtr.Zero) + throw new ArgumentException ("`clazz` must not be IntPtr.Zero.", "clazz"); + + var tmp = JniEnvironment.Current.Invoker.IsInstanceOf (JniEnvironment.Current.SafeHandle, obj.Handle, clazz.Handle); + return tmp; + } + + internal static unsafe int RegisterNatives (JniObjectReference jclass, JniNativeMethodRegistration [] methods, int nMethods) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.RegisterNatives (JniEnvironment.Current.SafeHandle, jclass.Handle, methods, nMethods); + + Exception __e = JniEnvironment.Current.GetExceptionForLastThrowable (); + if (__e != null) + throw __e; + + return tmp; + } + + internal static unsafe int UnregisterNatives (JniObjectReference jclass) + { + if (jclass.Handle == IntPtr.Zero) + throw new ArgumentException ("`jclass` must not be IntPtr.Zero.", "jclass"); + + var tmp = JniEnvironment.Current.Invoker.UnregisterNatives (JniEnvironment.Current.SafeHandle, jclass.Handle); + return tmp; + } + } + + internal static partial class Versions { + + internal static unsafe int GetVersion () + { + var tmp = JniEnvironment.Current.Invoker.GetVersion (JniEnvironment.Current.SafeHandle); + return tmp; + } + } + } + + partial class JniEnvironmentInvoker { + + internal JniNativeInterfaceStruct env; + + public unsafe JniEnvironmentInvoker (JniNativeInterfaceStruct* p) + { + env = *p; + } + + + JniFunc_JniEnvironmentSafeHandle_int _GetVersion; + public JniFunc_JniEnvironmentSafeHandle_int GetVersion { + get { + if (_GetVersion == null) + _GetVersion = (JniFunc_JniEnvironmentSafeHandle_int) Marshal.GetDelegateForFunctionPointer (env.GetVersion, typeof (JniFunc_JniEnvironmentSafeHandle_int)); + return _GetVersion; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_jobject_IntPtr_int_jobject _DefineClass; + public JniFunc_JniEnvironmentSafeHandle_string_jobject_IntPtr_int_jobject DefineClass { + get { + if (_DefineClass == null) + _DefineClass = (JniFunc_JniEnvironmentSafeHandle_string_jobject_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.DefineClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_jobject_IntPtr_int_jobject)); + return _DefineClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_jobject _FindClass; + public JniFunc_JniEnvironmentSafeHandle_string_jobject FindClass { + get { + if (_FindClass == null) + _FindClass = (JniFunc_JniEnvironmentSafeHandle_string_jobject) Marshal.GetDelegateForFunctionPointer (env.FindClass, typeof (JniFunc_JniEnvironmentSafeHandle_string_jobject)); + return _FindClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID _FromReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID FromReflectedMethod { + get { + if (_FromReflectedMethod == null) + _FromReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID)); + return _FromReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID _FromReflectedField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID FromReflectedField { + get { + if (_FromReflectedField == null) + _FromReflectedField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.FromReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID)); + return _FromReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool_jobject _ToReflectedMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool_jobject ToReflectedMethod { + get { + if (_ToReflectedMethod == null) + _ToReflectedMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool_jobject)); + return _ToReflectedMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _GetSuperclass; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject GetSuperclass { + get { + if (_GetSuperclass == null) + _GetSuperclass = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetSuperclass, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _GetSuperclass; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool _IsAssignableFrom; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool IsAssignableFrom { + get { + if (_IsAssignableFrom == null) + _IsAssignableFrom = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool) Marshal.GetDelegateForFunctionPointer (env.IsAssignableFrom, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool)); + return _IsAssignableFrom; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool_jobject _ToReflectedField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool_jobject ToReflectedField { + get { + if (_ToReflectedField == null) + _ToReflectedField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool_jobject) Marshal.GetDelegateForFunctionPointer (env.ToReflectedField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool_jobject)); + return _ToReflectedField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _Throw; + public JniFunc_JniEnvironmentSafeHandle_jobject_int Throw { + get { + if (_Throw == null) + _Throw = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.Throw, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _Throw; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_string_int _ThrowNew; + public JniFunc_JniEnvironmentSafeHandle_jobject_string_int ThrowNew { + get { + if (_ThrowNew == null) + _ThrowNew = (JniFunc_JniEnvironmentSafeHandle_jobject_string_int) Marshal.GetDelegateForFunctionPointer (env.ThrowNew, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_string_int)); + return _ThrowNew; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject _ExceptionOccurred; + public JniFunc_JniEnvironmentSafeHandle_jobject ExceptionOccurred { + get { + if (_ExceptionOccurred == null) + _ExceptionOccurred = (JniFunc_JniEnvironmentSafeHandle_jobject) Marshal.GetDelegateForFunctionPointer (env.ExceptionOccurred, typeof (JniFunc_JniEnvironmentSafeHandle_jobject)); + return _ExceptionOccurred; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionDescribe; + public JniAction_JniEnvironmentSafeHandle ExceptionDescribe { + get { + if (_ExceptionDescribe == null) + _ExceptionDescribe = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionDescribe, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionDescribe; + } + } + + JniAction_JniEnvironmentSafeHandle _ExceptionClear; + public JniAction_JniEnvironmentSafeHandle ExceptionClear { + get { + if (_ExceptionClear == null) + _ExceptionClear = (JniAction_JniEnvironmentSafeHandle) Marshal.GetDelegateForFunctionPointer (env.ExceptionClear, typeof (JniAction_JniEnvironmentSafeHandle)); + return _ExceptionClear; + } + } + + JniAction_JniEnvironmentSafeHandle_string _FatalError; + public JniAction_JniEnvironmentSafeHandle_string FatalError { + get { + if (_FatalError == null) + _FatalError = (JniAction_JniEnvironmentSafeHandle_string) Marshal.GetDelegateForFunctionPointer (env.FatalError, typeof (JniAction_JniEnvironmentSafeHandle_string)); + return _FatalError; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _PushLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_int_int PushLocalFrame { + get { + if (_PushLocalFrame == null) + _PushLocalFrame = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.PushLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _PushLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _PopLocalFrame; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject PopLocalFrame { + get { + if (_PopLocalFrame == null) + _PopLocalFrame = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.PopLocalFrame, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _PopLocalFrame; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _NewGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject NewGlobalRef { + get { + if (_NewGlobalRef == null) + _NewGlobalRef = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _NewGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteGlobalRef { + get { + if (_DeleteGlobalRef == null) + _DeleteGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteLocalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteLocalRef { + get { + if (_DeleteLocalRef == null) + _DeleteLocalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteLocalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool _IsSameObject; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool IsSameObject { + get { + if (_IsSameObject == null) + _IsSameObject = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool) Marshal.GetDelegateForFunctionPointer (env.IsSameObject, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool)); + return _IsSameObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _NewLocalRef; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject NewLocalRef { + get { + if (_NewLocalRef == null) + _NewLocalRef = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLocalRef, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _NewLocalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_int _EnsureLocalCapacity; + public JniFunc_JniEnvironmentSafeHandle_int_int EnsureLocalCapacity { + get { + if (_EnsureLocalCapacity == null) + _EnsureLocalCapacity = (JniFunc_JniEnvironmentSafeHandle_int_int) Marshal.GetDelegateForFunctionPointer (env.EnsureLocalCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_int_int)); + return _EnsureLocalCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _AllocObject; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject AllocObject { + get { + if (_AllocObject == null) + _AllocObject = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.AllocObject, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _AllocObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject _NewObject; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject NewObject { + get { + if (_NewObject == null) + _NewObject = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObject, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject)); + return _NewObject; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject _NewObjectA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject NewObjectA { + get { + if (_NewObjectA == null) + _NewObjectA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject)); + return _NewObjectA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _GetObjectClass; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject GetObjectClass { + get { + if (_GetObjectClass == null) + _GetObjectClass = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectClass, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _GetObjectClass; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool _IsInstanceOf; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool IsInstanceOf { + get { + if (_IsInstanceOf == null) + _IsInstanceOf = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool) Marshal.GetDelegateForFunctionPointer (env.IsInstanceOf, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_bool)); + return _IsInstanceOf; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceMethodID _GetMethodID; + public JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceMethodID GetMethodID { + get { + if (_GetMethodID == null) + _GetMethodID = (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.GetMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceMethodID)); + return _GetMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject _CallObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject CallObjectMethod { + get { + if (_CallObjectMethod == null) + _CallObjectMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_jobject)); + return _CallObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject _CallObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject CallObjectMethodA { + get { + if (_CallObjectMethodA == null) + _CallObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_jobject)); + return _CallObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool _CallBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool CallBooleanMethod { + get { + if (_CallBooleanMethod == null) + _CallBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_bool)); + return _CallBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_bool _CallBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_bool CallBooleanMethodA { + get { + if (_CallBooleanMethodA == null) + _CallBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_bool)); + return _CallBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_sbyte _CallSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_sbyte CallSByteMethod { + get { + if (_CallSByteMethod == null) + _CallSByteMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_sbyte)); + return _CallSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_sbyte _CallSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_sbyte CallSByteMethodA { + get { + if (_CallSByteMethodA == null) + _CallSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_sbyte)); + return _CallSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_char _CallCharMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_char CallCharMethod { + get { + if (_CallCharMethod == null) + _CallCharMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_char)); + return _CallCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_char _CallCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_char CallCharMethodA { + get { + if (_CallCharMethodA == null) + _CallCharMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_char)); + return _CallCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_short _CallShortMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_short CallShortMethod { + get { + if (_CallShortMethod == null) + _CallShortMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_short)); + return _CallShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_short _CallShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_short CallShortMethodA { + get { + if (_CallShortMethodA == null) + _CallShortMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_short)); + return _CallShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_int _CallIntMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_int CallIntMethod { + get { + if (_CallIntMethod == null) + _CallIntMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_int)); + return _CallIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_int _CallIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_int CallIntMethodA { + get { + if (_CallIntMethodA == null) + _CallIntMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_int)); + return _CallIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_long _CallLongMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_long CallLongMethod { + get { + if (_CallLongMethod == null) + _CallLongMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_long)); + return _CallLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_long _CallLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_long CallLongMethodA { + get { + if (_CallLongMethodA == null) + _CallLongMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_long)); + return _CallLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_float _CallFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_float CallFloatMethod { + get { + if (_CallFloatMethod == null) + _CallFloatMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_float)); + return _CallFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_float _CallFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_float CallFloatMethodA { + get { + if (_CallFloatMethodA == null) + _CallFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_float)); + return _CallFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_double _CallDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_double CallDoubleMethod { + get { + if (_CallDoubleMethod == null) + _CallDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_double)); + return _CallDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_double _CallDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_double CallDoubleMethodA { + get { + if (_CallDoubleMethodA == null) + _CallDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef_double)); + return _CallDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID _CallVoidMethod; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID CallVoidMethod { + get { + if (_CallVoidMethod == null) + _CallVoidMethod = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID)); + return _CallVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef _CallVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef CallVoidMethodA { + get { + if (_CallVoidMethodA == null) + _CallVoidMethodA = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceMethodID_JValueRef)); + return _CallVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_jobject _CallNonvirtualObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_jobject CallNonvirtualObjectMethod { + get { + if (_CallNonvirtualObjectMethod == null) + _CallNonvirtualObjectMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_jobject)); + return _CallNonvirtualObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_jobject _CallNonvirtualObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_jobject CallNonvirtualObjectMethodA { + get { + if (_CallNonvirtualObjectMethodA == null) + _CallNonvirtualObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_jobject)); + return _CallNonvirtualObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_bool _CallNonvirtualBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_bool CallNonvirtualBooleanMethod { + get { + if (_CallNonvirtualBooleanMethod == null) + _CallNonvirtualBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_bool)); + return _CallNonvirtualBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_bool _CallNonvirtualBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_bool CallNonvirtualBooleanMethodA { + get { + if (_CallNonvirtualBooleanMethodA == null) + _CallNonvirtualBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_bool)); + return _CallNonvirtualBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_sbyte _CallNonvirtualSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_sbyte CallNonvirtualSByteMethod { + get { + if (_CallNonvirtualSByteMethod == null) + _CallNonvirtualSByteMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_sbyte)); + return _CallNonvirtualSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_sbyte _CallNonvirtualSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_sbyte CallNonvirtualSByteMethodA { + get { + if (_CallNonvirtualSByteMethodA == null) + _CallNonvirtualSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_sbyte)); + return _CallNonvirtualSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_char _CallNonvirtualCharMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_char CallNonvirtualCharMethod { + get { + if (_CallNonvirtualCharMethod == null) + _CallNonvirtualCharMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_char)); + return _CallNonvirtualCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_char _CallNonvirtualCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_char CallNonvirtualCharMethodA { + get { + if (_CallNonvirtualCharMethodA == null) + _CallNonvirtualCharMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_char)); + return _CallNonvirtualCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_short _CallNonvirtualShortMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_short CallNonvirtualShortMethod { + get { + if (_CallNonvirtualShortMethod == null) + _CallNonvirtualShortMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_short)); + return _CallNonvirtualShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_short _CallNonvirtualShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_short CallNonvirtualShortMethodA { + get { + if (_CallNonvirtualShortMethodA == null) + _CallNonvirtualShortMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_short)); + return _CallNonvirtualShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_int _CallNonvirtualIntMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_int CallNonvirtualIntMethod { + get { + if (_CallNonvirtualIntMethod == null) + _CallNonvirtualIntMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_int)); + return _CallNonvirtualIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_int _CallNonvirtualIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_int CallNonvirtualIntMethodA { + get { + if (_CallNonvirtualIntMethodA == null) + _CallNonvirtualIntMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_int)); + return _CallNonvirtualIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_long _CallNonvirtualLongMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_long CallNonvirtualLongMethod { + get { + if (_CallNonvirtualLongMethod == null) + _CallNonvirtualLongMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_long)); + return _CallNonvirtualLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_long _CallNonvirtualLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_long CallNonvirtualLongMethodA { + get { + if (_CallNonvirtualLongMethodA == null) + _CallNonvirtualLongMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_long)); + return _CallNonvirtualLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_float _CallNonvirtualFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_float CallNonvirtualFloatMethod { + get { + if (_CallNonvirtualFloatMethod == null) + _CallNonvirtualFloatMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_float)); + return _CallNonvirtualFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_float _CallNonvirtualFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_float CallNonvirtualFloatMethodA { + get { + if (_CallNonvirtualFloatMethodA == null) + _CallNonvirtualFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_float)); + return _CallNonvirtualFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_double _CallNonvirtualDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_double CallNonvirtualDoubleMethod { + get { + if (_CallNonvirtualDoubleMethod == null) + _CallNonvirtualDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_double)); + return _CallNonvirtualDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_double _CallNonvirtualDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_double CallNonvirtualDoubleMethodA { + get { + if (_CallNonvirtualDoubleMethodA == null) + _CallNonvirtualDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef_double)); + return _CallNonvirtualDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID _CallNonvirtualVoidMethod; + public JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID CallNonvirtualVoidMethod { + get { + if (_CallNonvirtualVoidMethod == null) + _CallNonvirtualVoidMethod = (JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID)); + return _CallNonvirtualVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef _CallNonvirtualVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef CallNonvirtualVoidMethodA { + get { + if (_CallNonvirtualVoidMethodA == null) + _CallNonvirtualVoidMethodA = (JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallNonvirtualVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jobject_jinstanceMethodID_JValueRef)); + return _CallNonvirtualVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceFieldID _GetFieldID; + public JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceFieldID GetFieldID { + get { + if (_GetFieldID == null) + _GetFieldID = (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceFieldID) Marshal.GetDelegateForFunctionPointer (env.GetFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jinstanceFieldID)); + return _GetFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject _GetObjectField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject GetObjectField { + get { + if (_GetObjectField == null) + _GetObjectField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject)); + return _GetObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool _GetBooleanField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool GetBooleanField { + get { + if (_GetBooleanField == null) + _GetBooleanField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool)); + return _GetBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte _GetByteField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte GetByteField { + get { + if (_GetByteField == null) + _GetByteField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetByteField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte)); + return _GetByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char _GetCharField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char GetCharField { + get { + if (_GetCharField == null) + _GetCharField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetCharField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char)); + return _GetCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short _GetShortField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short GetShortField { + get { + if (_GetShortField == null) + _GetShortField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetShortField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short)); + return _GetShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int _GetIntField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int GetIntField { + get { + if (_GetIntField == null) + _GetIntField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetIntField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int)); + return _GetIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long _GetLongField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long GetLongField { + get { + if (_GetLongField == null) + _GetLongField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetLongField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long)); + return _GetLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float _GetFloatField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float GetFloatField { + get { + if (_GetFloatField == null) + _GetFloatField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float)); + return _GetFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double _GetDoubleField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double GetDoubleField { + get { + if (_GetDoubleField == null) + _GetDoubleField = (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double)); + return _GetDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject _SetObjectField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject SetObjectField { + get { + if (_SetObjectField == null) + _SetObjectField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_jobject)); + return _SetObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool _SetBooleanField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool SetBooleanField { + get { + if (_SetBooleanField == null) + _SetBooleanField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_bool)); + return _SetBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte _SetByteField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte SetByteField { + get { + if (_SetByteField == null) + _SetByteField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetByteField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_sbyte)); + return _SetByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char _SetCharField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char SetCharField { + get { + if (_SetCharField == null) + _SetCharField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetCharField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_char)); + return _SetCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short _SetShortField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short SetShortField { + get { + if (_SetShortField == null) + _SetShortField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetShortField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_short)); + return _SetShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int _SetIntField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int SetIntField { + get { + if (_SetIntField == null) + _SetIntField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetIntField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_int)); + return _SetIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long _SetLongField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long SetLongField { + get { + if (_SetLongField == null) + _SetLongField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetLongField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_long)); + return _SetLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float _SetFloatField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float SetFloatField { + get { + if (_SetFloatField == null) + _SetFloatField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetFloatField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_float)); + return _SetFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double _SetDoubleField; + public JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double SetDoubleField { + get { + if (_SetDoubleField == null) + _SetDoubleField = (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jinstanceFieldID_double)); + return _SetDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticMethodID _GetStaticMethodID; + public JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticMethodID GetStaticMethodID { + get { + if (_GetStaticMethodID == null) + _GetStaticMethodID = (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticMethodID) Marshal.GetDelegateForFunctionPointer (env.GetStaticMethodID, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticMethodID)); + return _GetStaticMethodID; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_jobject _CallStaticObjectMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_jobject CallStaticObjectMethod { + get { + if (_CallStaticObjectMethod == null) + _CallStaticObjectMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_jobject)); + return _CallStaticObjectMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_jobject _CallStaticObjectMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_jobject CallStaticObjectMethodA { + get { + if (_CallStaticObjectMethodA == null) + _CallStaticObjectMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_jobject) Marshal.GetDelegateForFunctionPointer (env.CallStaticObjectMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_jobject)); + return _CallStaticObjectMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_bool _CallStaticBooleanMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_bool CallStaticBooleanMethod { + get { + if (_CallStaticBooleanMethod == null) + _CallStaticBooleanMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_bool)); + return _CallStaticBooleanMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_bool _CallStaticBooleanMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_bool CallStaticBooleanMethodA { + get { + if (_CallStaticBooleanMethodA == null) + _CallStaticBooleanMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_bool) Marshal.GetDelegateForFunctionPointer (env.CallStaticBooleanMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_bool)); + return _CallStaticBooleanMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_sbyte _CallStaticSByteMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_sbyte CallStaticSByteMethod { + get { + if (_CallStaticSByteMethod == null) + _CallStaticSByteMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_sbyte)); + return _CallStaticSByteMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_sbyte _CallStaticSByteMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_sbyte CallStaticSByteMethodA { + get { + if (_CallStaticSByteMethodA == null) + _CallStaticSByteMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_sbyte) Marshal.GetDelegateForFunctionPointer (env.CallStaticSByteMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_sbyte)); + return _CallStaticSByteMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_char _CallStaticCharMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_char CallStaticCharMethod { + get { + if (_CallStaticCharMethod == null) + _CallStaticCharMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_char)); + return _CallStaticCharMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_char _CallStaticCharMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_char CallStaticCharMethodA { + get { + if (_CallStaticCharMethodA == null) + _CallStaticCharMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_char) Marshal.GetDelegateForFunctionPointer (env.CallStaticCharMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_char)); + return _CallStaticCharMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_short _CallStaticShortMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_short CallStaticShortMethod { + get { + if (_CallStaticShortMethod == null) + _CallStaticShortMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_short)); + return _CallStaticShortMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_short _CallStaticShortMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_short CallStaticShortMethodA { + get { + if (_CallStaticShortMethodA == null) + _CallStaticShortMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_short) Marshal.GetDelegateForFunctionPointer (env.CallStaticShortMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_short)); + return _CallStaticShortMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_int _CallStaticIntMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_int CallStaticIntMethod { + get { + if (_CallStaticIntMethod == null) + _CallStaticIntMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_int)); + return _CallStaticIntMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_int _CallStaticIntMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_int CallStaticIntMethodA { + get { + if (_CallStaticIntMethodA == null) + _CallStaticIntMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_int) Marshal.GetDelegateForFunctionPointer (env.CallStaticIntMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_int)); + return _CallStaticIntMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_long _CallStaticLongMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_long CallStaticLongMethod { + get { + if (_CallStaticLongMethod == null) + _CallStaticLongMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_long)); + return _CallStaticLongMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_long _CallStaticLongMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_long CallStaticLongMethodA { + get { + if (_CallStaticLongMethodA == null) + _CallStaticLongMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_long) Marshal.GetDelegateForFunctionPointer (env.CallStaticLongMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_long)); + return _CallStaticLongMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_float _CallStaticFloatMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_float CallStaticFloatMethod { + get { + if (_CallStaticFloatMethod == null) + _CallStaticFloatMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_float)); + return _CallStaticFloatMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_float _CallStaticFloatMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_float CallStaticFloatMethodA { + get { + if (_CallStaticFloatMethodA == null) + _CallStaticFloatMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_float) Marshal.GetDelegateForFunctionPointer (env.CallStaticFloatMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_float)); + return _CallStaticFloatMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_double _CallStaticDoubleMethod; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_double CallStaticDoubleMethod { + get { + if (_CallStaticDoubleMethod == null) + _CallStaticDoubleMethod = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethod, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_double)); + return _CallStaticDoubleMethod; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_double _CallStaticDoubleMethodA; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_double CallStaticDoubleMethodA { + get { + if (_CallStaticDoubleMethodA == null) + _CallStaticDoubleMethodA = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_double) Marshal.GetDelegateForFunctionPointer (env.CallStaticDoubleMethodA, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef_double)); + return _CallStaticDoubleMethodA; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID _CallStaticVoidMethod; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID CallStaticVoidMethod { + get { + if (_CallStaticVoidMethod == null) + _CallStaticVoidMethod = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethod, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID)); + return _CallStaticVoidMethod; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef _CallStaticVoidMethodA; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef CallStaticVoidMethodA { + get { + if (_CallStaticVoidMethodA == null) + _CallStaticVoidMethodA = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef) Marshal.GetDelegateForFunctionPointer (env.CallStaticVoidMethodA, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticMethodID_JValueRef)); + return _CallStaticVoidMethodA; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticFieldID _GetStaticFieldID; + public JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticFieldID GetStaticFieldID { + get { + if (_GetStaticFieldID == null) + _GetStaticFieldID = (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticFieldID) Marshal.GetDelegateForFunctionPointer (env.GetStaticFieldID, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_string_string_jstaticFieldID)); + return _GetStaticFieldID; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject _GetStaticObjectField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject GetStaticObjectField { + get { + if (_GetStaticObjectField == null) + _GetStaticObjectField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.GetStaticObjectField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject)); + return _GetStaticObjectField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool _GetStaticBooleanField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool GetStaticBooleanField { + get { + if (_GetStaticBooleanField == null) + _GetStaticBooleanField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.GetStaticBooleanField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool)); + return _GetStaticBooleanField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte _GetStaticByteField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte GetStaticByteField { + get { + if (_GetStaticByteField == null) + _GetStaticByteField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.GetStaticByteField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte)); + return _GetStaticByteField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char _GetStaticCharField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char GetStaticCharField { + get { + if (_GetStaticCharField == null) + _GetStaticCharField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.GetStaticCharField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char)); + return _GetStaticCharField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short _GetStaticShortField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short GetStaticShortField { + get { + if (_GetStaticShortField == null) + _GetStaticShortField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.GetStaticShortField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short)); + return _GetStaticShortField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int _GetStaticIntField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int GetStaticIntField { + get { + if (_GetStaticIntField == null) + _GetStaticIntField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.GetStaticIntField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int)); + return _GetStaticIntField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long _GetStaticLongField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long GetStaticLongField { + get { + if (_GetStaticLongField == null) + _GetStaticLongField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.GetStaticLongField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long)); + return _GetStaticLongField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float _GetStaticFloatField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float GetStaticFloatField { + get { + if (_GetStaticFloatField == null) + _GetStaticFloatField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.GetStaticFloatField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float)); + return _GetStaticFloatField; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double _GetStaticDoubleField; + public JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double GetStaticDoubleField { + get { + if (_GetStaticDoubleField == null) + _GetStaticDoubleField = (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.GetStaticDoubleField, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double)); + return _GetStaticDoubleField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject _SetStaticObjectField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject SetStaticObjectField { + get { + if (_SetStaticObjectField == null) + _SetStaticObjectField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject) Marshal.GetDelegateForFunctionPointer (env.SetStaticObjectField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_jobject)); + return _SetStaticObjectField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool _SetStaticBooleanField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool SetStaticBooleanField { + get { + if (_SetStaticBooleanField == null) + _SetStaticBooleanField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool) Marshal.GetDelegateForFunctionPointer (env.SetStaticBooleanField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_bool)); + return _SetStaticBooleanField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte _SetStaticByteField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte SetStaticByteField { + get { + if (_SetStaticByteField == null) + _SetStaticByteField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte) Marshal.GetDelegateForFunctionPointer (env.SetStaticByteField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_sbyte)); + return _SetStaticByteField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char _SetStaticCharField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char SetStaticCharField { + get { + if (_SetStaticCharField == null) + _SetStaticCharField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char) Marshal.GetDelegateForFunctionPointer (env.SetStaticCharField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_char)); + return _SetStaticCharField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short _SetStaticShortField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short SetStaticShortField { + get { + if (_SetStaticShortField == null) + _SetStaticShortField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short) Marshal.GetDelegateForFunctionPointer (env.SetStaticShortField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_short)); + return _SetStaticShortField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int _SetStaticIntField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int SetStaticIntField { + get { + if (_SetStaticIntField == null) + _SetStaticIntField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int) Marshal.GetDelegateForFunctionPointer (env.SetStaticIntField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_int)); + return _SetStaticIntField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long _SetStaticLongField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long SetStaticLongField { + get { + if (_SetStaticLongField == null) + _SetStaticLongField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long) Marshal.GetDelegateForFunctionPointer (env.SetStaticLongField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_long)); + return _SetStaticLongField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float _SetStaticFloatField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float SetStaticFloatField { + get { + if (_SetStaticFloatField == null) + _SetStaticFloatField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float) Marshal.GetDelegateForFunctionPointer (env.SetStaticFloatField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_float)); + return _SetStaticFloatField; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double _SetStaticDoubleField; + public JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double SetStaticDoubleField { + get { + if (_SetStaticDoubleField == null) + _SetStaticDoubleField = (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double) Marshal.GetDelegateForFunctionPointer (env.SetStaticDoubleField, typeof (JniAction_JniEnvironmentSafeHandle_jobject_jstaticFieldID_double)); + return _SetStaticDoubleField; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject _NewString; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject NewString { + get { + if (_NewString == null) + _NewString = (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewString, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_int_jobject)); + return _NewString; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _GetStringLength; + public JniFunc_JniEnvironmentSafeHandle_jobject_int GetStringLength { + get { + if (_GetStringLength == null) + _GetStringLength = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringLength, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _GetStringLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetStringChars; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetStringChars { + get { + if (_GetStringChars == null) + _GetStringChars = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringChars, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetStringChars; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr _ReleaseStringChars; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr ReleaseStringChars { + get { + if (_ReleaseStringChars == null) + _ReleaseStringChars = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringChars, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr)); + return _ReleaseStringChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_string_jobject _NewStringUTF; + public JniFunc_JniEnvironmentSafeHandle_string_jobject NewStringUTF { + get { + if (_NewStringUTF == null) + _NewStringUTF = (JniFunc_JniEnvironmentSafeHandle_string_jobject) Marshal.GetDelegateForFunctionPointer (env.NewStringUTF, typeof (JniFunc_JniEnvironmentSafeHandle_string_jobject)); + return _NewStringUTF; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _GetStringUTFLength; + public JniFunc_JniEnvironmentSafeHandle_jobject_int GetStringUTFLength { + get { + if (_GetStringUTFLength == null) + _GetStringUTFLength = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFLength, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _GetStringUTFLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string _GetStringUTFChars; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string GetStringUTFChars { + get { + if (_GetStringUTFChars == null) + _GetStringUTFChars = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFChars, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string)); + return _GetStringUTFChars; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_string _ReleaseStringUTFChars; + public JniAction_JniEnvironmentSafeHandle_jobject_string ReleaseStringUTFChars { + get { + if (_ReleaseStringUTFChars == null) + _ReleaseStringUTFChars = (JniAction_JniEnvironmentSafeHandle_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringUTFChars, typeof (JniAction_JniEnvironmentSafeHandle_jobject_string)); + return _ReleaseStringUTFChars; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _GetArrayLength; + public JniFunc_JniEnvironmentSafeHandle_jobject_int GetArrayLength { + get { + if (_GetArrayLength == null) + _GetArrayLength = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.GetArrayLength, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _GetArrayLength; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject_jobject_jobject _NewObjectArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject_jobject_jobject NewObjectArray { + get { + if (_NewObjectArray == null) + _NewObjectArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewObjectArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject_jobject_jobject)); + return _NewObjectArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int_jobject _GetObjectArrayElement; + public JniFunc_JniEnvironmentSafeHandle_jobject_int_jobject GetObjectArrayElement { + get { + if (_GetObjectArrayElement == null) + _GetObjectArrayElement = (JniFunc_JniEnvironmentSafeHandle_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.GetObjectArrayElement, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int_jobject)); + return _GetObjectArrayElement; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_jobject _SetObjectArrayElement; + public JniAction_JniEnvironmentSafeHandle_jobject_int_jobject SetObjectArrayElement { + get { + if (_SetObjectArrayElement == null) + _SetObjectArrayElement = (JniAction_JniEnvironmentSafeHandle_jobject_int_jobject) Marshal.GetDelegateForFunctionPointer (env.SetObjectArrayElement, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_jobject)); + return _SetObjectArrayElement; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewBooleanArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewBooleanArray { + get { + if (_NewBooleanArray == null) + _NewBooleanArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewBooleanArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewBooleanArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewByteArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewByteArray { + get { + if (_NewByteArray == null) + _NewByteArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewByteArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewByteArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewCharArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewCharArray { + get { + if (_NewCharArray == null) + _NewCharArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewCharArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewCharArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewShortArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewShortArray { + get { + if (_NewShortArray == null) + _NewShortArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewShortArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewShortArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewIntArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewIntArray { + get { + if (_NewIntArray == null) + _NewIntArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewIntArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewIntArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewLongArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewLongArray { + get { + if (_NewLongArray == null) + _NewLongArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewLongArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewLongArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewFloatArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewFloatArray { + get { + if (_NewFloatArray == null) + _NewFloatArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewFloatArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewFloatArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_int_jobject _NewDoubleArray; + public JniFunc_JniEnvironmentSafeHandle_int_jobject NewDoubleArray { + get { + if (_NewDoubleArray == null) + _NewDoubleArray = (JniFunc_JniEnvironmentSafeHandle_int_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDoubleArray, typeof (JniFunc_JniEnvironmentSafeHandle_int_jobject)); + return _NewDoubleArray; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetBooleanArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetBooleanArrayElements { + get { + if (_GetBooleanArrayElements == null) + _GetBooleanArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetBooleanArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetByteArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetByteArrayElements { + get { + if (_GetByteArrayElements == null) + _GetByteArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetByteArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetCharArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetCharArrayElements { + get { + if (_GetCharArrayElements == null) + _GetCharArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetCharArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetShortArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetShortArrayElements { + get { + if (_GetShortArrayElements == null) + _GetShortArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetShortArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetIntArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetIntArrayElements { + get { + if (_GetIntArrayElements == null) + _GetIntArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetIntArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetLongArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetLongArrayElements { + get { + if (_GetLongArrayElements == null) + _GetLongArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetLongArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetFloatArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetFloatArrayElements { + get { + if (_GetFloatArrayElements == null) + _GetFloatArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetFloatArrayElements; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetDoubleArrayElements; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetDoubleArrayElements { + get { + if (_GetDoubleArrayElements == null) + _GetDoubleArrayElements = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayElements, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseBooleanArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseBooleanArrayElements { + get { + if (_ReleaseBooleanArrayElements == null) + _ReleaseBooleanArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseBooleanArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseBooleanArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseByteArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseByteArrayElements { + get { + if (_ReleaseByteArrayElements == null) + _ReleaseByteArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseByteArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseByteArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseCharArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseCharArrayElements { + get { + if (_ReleaseCharArrayElements == null) + _ReleaseCharArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseCharArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseCharArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseShortArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseShortArrayElements { + get { + if (_ReleaseShortArrayElements == null) + _ReleaseShortArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseShortArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseShortArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseIntArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseIntArrayElements { + get { + if (_ReleaseIntArrayElements == null) + _ReleaseIntArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseIntArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseIntArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseLongArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseLongArrayElements { + get { + if (_ReleaseLongArrayElements == null) + _ReleaseLongArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseLongArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseLongArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseFloatArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseFloatArrayElements { + get { + if (_ReleaseFloatArrayElements == null) + _ReleaseFloatArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseFloatArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseFloatArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleaseDoubleArrayElements; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleaseDoubleArrayElements { + get { + if (_ReleaseDoubleArrayElements == null) + _ReleaseDoubleArrayElements = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleaseDoubleArrayElements, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleaseDoubleArrayElements; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetBooleanArrayRegion { + get { + if (_GetBooleanArrayRegion == null) + _GetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetByteArrayRegion { + get { + if (_GetByteArrayRegion == null) + _GetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetCharArrayRegion { + get { + if (_GetCharArrayRegion == null) + _GetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetShortArrayRegion { + get { + if (_GetShortArrayRegion == null) + _GetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetIntArrayRegion { + get { + if (_GetIntArrayRegion == null) + _GetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetLongArrayRegion { + get { + if (_GetLongArrayRegion == null) + _GetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetFloatArrayRegion { + get { + if (_GetFloatArrayRegion == null) + _GetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetDoubleArrayRegion { + get { + if (_GetDoubleArrayRegion == null) + _GetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetDoubleArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetBooleanArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetBooleanArrayRegion { + get { + if (_SetBooleanArrayRegion == null) + _SetBooleanArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetBooleanArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetBooleanArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetByteArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetByteArrayRegion { + get { + if (_SetByteArrayRegion == null) + _SetByteArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetByteArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetByteArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetCharArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetCharArrayRegion { + get { + if (_SetCharArrayRegion == null) + _SetCharArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetCharArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetCharArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetShortArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetShortArrayRegion { + get { + if (_SetShortArrayRegion == null) + _SetShortArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetShortArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetShortArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetIntArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetIntArrayRegion { + get { + if (_SetIntArrayRegion == null) + _SetIntArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetIntArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetIntArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetLongArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetLongArrayRegion { + get { + if (_SetLongArrayRegion == null) + _SetLongArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetLongArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetLongArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetFloatArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetFloatArrayRegion { + get { + if (_SetFloatArrayRegion == null) + _SetFloatArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetFloatArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetFloatArrayRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _SetDoubleArrayRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr SetDoubleArrayRegion { + get { + if (_SetDoubleArrayRegion == null) + _SetDoubleArrayRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.SetDoubleArrayRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _SetDoubleArrayRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_JniNativeMethodRegistrationArray_int_int _RegisterNatives; + public JniFunc_JniEnvironmentSafeHandle_jobject_JniNativeMethodRegistrationArray_int_int RegisterNatives { + get { + if (_RegisterNatives == null) + _RegisterNatives = (JniFunc_JniEnvironmentSafeHandle_jobject_JniNativeMethodRegistrationArray_int_int) Marshal.GetDelegateForFunctionPointer (env.RegisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_JniNativeMethodRegistrationArray_int_int)); + return _RegisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _UnregisterNatives; + public JniFunc_JniEnvironmentSafeHandle_jobject_int UnregisterNatives { + get { + if (_UnregisterNatives == null) + _UnregisterNatives = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.UnregisterNatives, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _UnregisterNatives; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _MonitorEnter; + public JniFunc_JniEnvironmentSafeHandle_jobject_int MonitorEnter { + get { + if (_MonitorEnter == null) + _MonitorEnter = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorEnter, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _MonitorEnter; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_int _MonitorExit; + public JniFunc_JniEnvironmentSafeHandle_jobject_int MonitorExit { + get { + if (_MonitorExit == null) + _MonitorExit = (JniFunc_JniEnvironmentSafeHandle_jobject_int) Marshal.GetDelegateForFunctionPointer (env.MonitorExit, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_int)); + return _MonitorExit; + } + } + + JniFunc_JniEnvironmentSafeHandle_outIntPtr_int _GetJavaVM; + public JniFunc_JniEnvironmentSafeHandle_outIntPtr_int GetJavaVM { + get { + if (_GetJavaVM == null) + _GetJavaVM = (JniFunc_JniEnvironmentSafeHandle_outIntPtr_int) Marshal.GetDelegateForFunctionPointer (env.GetJavaVM, typeof (JniFunc_JniEnvironmentSafeHandle_outIntPtr_int)); + return _GetJavaVM; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetStringRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetStringRegion { + get { + if (_GetStringRegion == null) + _GetStringRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetStringRegion; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr _GetStringUTFRegion; + public JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr GetStringUTFRegion { + get { + if (_GetStringUTFRegion == null) + _GetStringUTFRegion = (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetStringUTFRegion, typeof (JniAction_JniEnvironmentSafeHandle_jobject_int_int_IntPtr)); + return _GetStringUTFRegion; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr _GetPrimitiveArrayCritical; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr GetPrimitiveArrayCritical { + get { + if (_GetPrimitiveArrayCritical == null) + _GetPrimitiveArrayCritical = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetPrimitiveArrayCritical, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_IntPtr)); + return _GetPrimitiveArrayCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int _ReleasePrimitiveArrayCritical; + public JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int ReleasePrimitiveArrayCritical { + get { + if (_ReleasePrimitiveArrayCritical == null) + _ReleasePrimitiveArrayCritical = (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int) Marshal.GetDelegateForFunctionPointer (env.ReleasePrimitiveArrayCritical, typeof (JniAction_JniEnvironmentSafeHandle_jobject_IntPtr_int)); + return _ReleasePrimitiveArrayCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string _GetStringCritical; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string GetStringCritical { + get { + if (_GetStringCritical == null) + _GetStringCritical = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string) Marshal.GetDelegateForFunctionPointer (env.GetStringCritical, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr_string)); + return _GetStringCritical; + } + } + + JniAction_JniEnvironmentSafeHandle_jobject_string _ReleaseStringCritical; + public JniAction_JniEnvironmentSafeHandle_jobject_string ReleaseStringCritical { + get { + if (_ReleaseStringCritical == null) + _ReleaseStringCritical = (JniAction_JniEnvironmentSafeHandle_jobject_string) Marshal.GetDelegateForFunctionPointer (env.ReleaseStringCritical, typeof (JniAction_JniEnvironmentSafeHandle_jobject_string)); + return _ReleaseStringCritical; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_jobject _NewWeakGlobalRef; + public JniFunc_JniEnvironmentSafeHandle_jobject_jobject NewWeakGlobalRef { + get { + if (_NewWeakGlobalRef == null) + _NewWeakGlobalRef = (JniFunc_JniEnvironmentSafeHandle_jobject_jobject) Marshal.GetDelegateForFunctionPointer (env.NewWeakGlobalRef, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_jobject)); + return _NewWeakGlobalRef; + } + } + + JniAction_JniEnvironmentSafeHandle_IntPtr _DeleteWeakGlobalRef; + public JniAction_JniEnvironmentSafeHandle_IntPtr DeleteWeakGlobalRef { + get { + if (_DeleteWeakGlobalRef == null) + _DeleteWeakGlobalRef = (JniAction_JniEnvironmentSafeHandle_IntPtr) Marshal.GetDelegateForFunctionPointer (env.DeleteWeakGlobalRef, typeof (JniAction_JniEnvironmentSafeHandle_IntPtr)); + return _DeleteWeakGlobalRef; + } + } + + JniFunc_JniEnvironmentSafeHandle_bool _ExceptionCheck; + public JniFunc_JniEnvironmentSafeHandle_bool ExceptionCheck { + get { + if (_ExceptionCheck == null) + _ExceptionCheck = (JniFunc_JniEnvironmentSafeHandle_bool) Marshal.GetDelegateForFunctionPointer (env.ExceptionCheck, typeof (JniFunc_JniEnvironmentSafeHandle_bool)); + return _ExceptionCheck; + } + } + + JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject _NewDirectByteBuffer; + public JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject NewDirectByteBuffer { + get { + if (_NewDirectByteBuffer == null) + _NewDirectByteBuffer = (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject) Marshal.GetDelegateForFunctionPointer (env.NewDirectByteBuffer, typeof (JniFunc_JniEnvironmentSafeHandle_IntPtr_long_jobject)); + return _NewDirectByteBuffer; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr _GetDirectBufferAddress; + public JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr GetDirectBufferAddress { + get { + if (_GetDirectBufferAddress == null) + _GetDirectBufferAddress = (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferAddress, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_IntPtr)); + return _GetDirectBufferAddress; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_long _GetDirectBufferCapacity; + public JniFunc_JniEnvironmentSafeHandle_jobject_long GetDirectBufferCapacity { + get { + if (_GetDirectBufferCapacity == null) + _GetDirectBufferCapacity = (JniFunc_JniEnvironmentSafeHandle_jobject_long) Marshal.GetDelegateForFunctionPointer (env.GetDirectBufferCapacity, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_long)); + return _GetDirectBufferCapacity; + } + } + + JniFunc_JniEnvironmentSafeHandle_jobject_JniObjectReferenceType _GetObjectRefType; + public JniFunc_JniEnvironmentSafeHandle_jobject_JniObjectReferenceType GetObjectRefType { + get { + if (_GetObjectRefType == null) + _GetObjectRefType = (JniFunc_JniEnvironmentSafeHandle_jobject_JniObjectReferenceType) Marshal.GetDelegateForFunctionPointer (env.GetObjectRefType, typeof (JniFunc_JniEnvironmentSafeHandle_jobject_JniObjectReferenceType)); + return _GetObjectRefType; + } + } + } +} +#endif // FEATURE_HANDLES_ARE_INTPTRS diff --git a/tests/invocation-overhead/test-overheads-xa.exe.config b/tests/invocation-overhead/test-overheads-xa.exe.config new file mode 100644 index 000000000..3d9277004 --- /dev/null +++ b/tests/invocation-overhead/test-overheads-xa.exe.config @@ -0,0 +1,3 @@ + + + diff --git a/tests/invocation-overhead/test-overheads.cs b/tests/invocation-overhead/test-overheads.cs new file mode 100644 index 000000000..eceff7e5c --- /dev/null +++ b/tests/invocation-overhead/test-overheads.cs @@ -0,0 +1,498 @@ +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using Java.Interop; +using Java.Interop.SafeHandles; +using Java.Interop.IntPtrs; + +using SafeEnv = Java.Interop.SafeHandles.JniEnvironment; +using IntPtrEnv = Java.Interop.IntPtrs.JniEnvironment; + +namespace Java.Interop { + public enum JniObjectReferenceType { + Invalid = 0, + Local = 1, + Global = 2, + WeakGlobal = 3, + } + + public struct JniObjectReference + { + public IntPtr Handle {get; private set;} + public JniObjectReferenceType Type {get; private set;} + + public JniObjectReference (IntPtr handle, JniObjectReferenceType type = JniObjectReferenceType.Invalid) + { + Handle = handle; + Type = type; + } + } + + [StructLayout(LayoutKind.Explicit)] + public struct JValue { +#pragma warning disable 0414 + [FieldOffset(0)] bool z; + [FieldOffset(0)] sbyte b; + [FieldOffset(0)] char c; + [FieldOffset(0)] short s; + [FieldOffset(0)] int i; + [FieldOffset(0)] long j; + [FieldOffset(0)] float f; + [FieldOffset(0)] double d; + [FieldOffset(0)] IntPtr l; +#pragma warning restore 0414 + + public static JValue Zero = new JValue ((JniReferenceSafeHandle) null); + + public JValue (bool value) + { + this = new JValue (); + z = value; + } + + public JValue (sbyte value) + { + this = new JValue (); + b = value; + } + + public JValue (char value) + { + this = new JValue (); + c = value; + } + + public JValue (short value) + { + this = new JValue (); + s = value; + } + + public JValue (int value) + { + this = new JValue (); + i = value; + } + + public JValue (long value) + { + this = new JValue (); + j = value; + } + + public JValue (float value) + { + this = new JValue (); + f = value; + } + + public JValue (double value) + { + this = new JValue (); + d = value; + } +#if XA + public JValue (IntPtr value) + { + this = new JValue (); + l = value; + } +#endif + public JValue (JniObjectReference value) + { + this = new JValue (); + l = value.Handle; + } + + public JValue (JniReferenceSafeHandle value) + { + this = new JValue (); + l = value == null ? IntPtr.Zero : value.DangerousGetHandle (); + } + + public override string ToString () + { + return string.Format ("Java.Interop.JValue(z={0},b={1},c={2},s={3},i={4},f={5},d={6},l=0x{7})", + z, b, c, s, i, f, d, l.ToString ("x")); + } + } + public abstract class JniFieldID : SafeHandle + { + internal JniFieldID () + : base (IntPtr.Zero, true) + { + } + + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + return true; + } + + public override bool IsInvalid { + get { + return handle == IntPtr.Zero; + } + } + + public override string ToString () + { + return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + } + } + + public sealed class JniStaticFieldID : JniFieldID + { + JniStaticFieldID () + { + } + } + public sealed class JniInstanceFieldID : JniFieldID + { + JniInstanceFieldID () + { + } + } + public abstract class JniMethodID : SafeHandle + { + internal JniMethodID () + : base (IntPtr.Zero, true) + { + } + + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + return true; + } + + public override bool IsInvalid { + get { + return handle == IntPtr.Zero; + } + } + + public override string ToString () + { + return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + } + } + public sealed class JniStaticMethodID : JniMethodID + { + JniStaticMethodID () + { + } + } + public sealed class JniInstanceMethodID : JniMethodID + { + JniInstanceMethodID () + { + } + } + public struct JniNativeMethodRegistration { + + public string Name; + public string Signature; + public Delegate Marshaler; + + public JniNativeMethodRegistration (string name, string signature, Delegate marshaler) + { + Name = name; + Signature = signature; + Marshaler = marshaler; + } + } + + public abstract class JniReferenceSafeHandle : SafeHandle + { + protected JniReferenceSafeHandle () + : this (ownsHandle:true) + { + } + + internal JniReferenceSafeHandle (bool ownsHandle) + : base (IntPtr.Zero, ownsHandle) + { + } + + public override bool IsInvalid { + get {return base.handle == IntPtr.Zero;} + } + + public JniObjectReferenceType ReferenceType { + get { + if (IsInvalid) + throw new ObjectDisposedException (GetType ().FullName); + return SafeHandles.JniEnvironment.Handles.GetObjectRefType (this); + } + } + + internal IntPtr _GetAndClearHandle () + { + var h = handle; + handle = IntPtr.Zero; + return h; + } + + public override string ToString () + { + return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + } + } + public class JniLocalReference : JniReferenceSafeHandle { + + internal JniLocalReference () + { + } + + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + SafeHandles.JniEnvironment.Handles.DeleteLocalRef (handle); + return true; + } + } + public class JniWeakGlobalReference : JniReferenceSafeHandle { + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + SafeHandles.JniEnvironment.Handles.DeleteWeakGlobalRef (handle); + return true; + } + } + public class JniGlobalReference : JniReferenceSafeHandle { + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + SafeHandles.JniEnvironment.Handles.DeleteGlobalRef (handle); + return true; + } + } + public sealed class JniEnvironmentSafeHandle : SafeHandle + { + JniEnvironmentSafeHandle () + : base (IntPtr.Zero, ownsHandle:false) + { + } + + public JniEnvironmentSafeHandle (IntPtr handle) + : this () + { + SetHandle (handle); + } + + public override bool IsInvalid { + get {return handle == IntPtr.Zero;} + } + + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + return false; + } + + internal unsafe SafeHandles.JniEnvironmentInvoker CreateInvoker () + { + IntPtr p = Marshal.ReadIntPtr (handle); + return new SafeHandles.JniEnvironmentInvoker ((JniNativeInterfaceStruct*) p); + } + + public override string ToString () + { + return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + } + } + public sealed class JavaVMSafeHandle : SafeHandle { + + JavaVMSafeHandle () + : base (IntPtr.Zero, ownsHandle:false) + { + } + + public JavaVMSafeHandle (IntPtr handle) + : this () + { + SetHandle (handle); + } + + public override bool IsInvalid { + get {return handle == IntPtr.Zero;} + } + + internal IntPtr Handle { + get {return base.handle;} + } + + protected override bool ReleaseHandle () + { + Console.WriteLine ("# {0}.ReleaseHandle()", GetType ().FullName); + return false; + } + + public override string ToString () + { + return string.Format ("{0}(0x{1})", GetType ().FullName, handle.ToString ("x")); + } + } + struct JavaVMInitArgs { + public JniVersion version; /* use JNI_VERSION_1_2 or later */ + + public int nOptions; + public IntPtr /* JavaVMOption[] */ options; + public byte ignoreUnrecognized; + } + + struct JavaVMOption { + public IntPtr /* const char* */ optionString; + public IntPtr /* void * */ extraInfo; + } + public enum JniVersion { + // v1_1 = 0x00010001, + v1_2 = 0x00010002, + v1_4 = 0x00010004, + v1_6 = 0x00010006, + } +} + +namespace Java.Interop.SafeHandles { + public partial class JniEnvironment { + public static JniEnvironment Current; + + internal JniEnvironmentInvoker Invoker; + public JniEnvironmentSafeHandle SafeHandle; + + public unsafe JniEnvironment (IntPtr v) { + Current = this; + SafeHandle = new JniEnvironmentSafeHandle (v); + IntPtr p = Marshal.ReadIntPtr (v); + Invoker = new JniEnvironmentInvoker ((JniNativeInterfaceStruct*) p); + } + internal void LogCreateLocalRef (JniLocalReference value) + { + } + public Exception GetExceptionForLastThrowable () + { + var v = SafeEnv.Errors.ExceptionOccurred (); + if (v == null || v.IsInvalid) + return null; + SafeEnv.Errors.ExceptionClear (); + LogCreateLocalRef (v); + v.Dispose (); + return new Exception ("yada yada yada"); + } + } +} + +namespace Java.Interop.IntPtrs { + public partial class JniEnvironment { + public static JniEnvironment Current; + + internal JniEnvironmentInvoker Invoker; + public IntPtr SafeHandle; + + public unsafe JniEnvironment (IntPtr v) { + Current = this; + SafeHandle = v; + IntPtr p = Marshal.ReadIntPtr (v); + Invoker = new JniEnvironmentInvoker ((JniNativeInterfaceStruct*) p); + } + internal void LogCreateLocalRef (IntPtr value) + { + } + public Exception GetExceptionForLastThrowable () + { + var v = IntPtrEnv.Errors.ExceptionOccurred (); + #if XA + var h = v; + #else + var h = v.Handle; + #endif + if (h == IntPtr.Zero) + return null; + SafeEnv.Errors.ExceptionClear (); + LogCreateLocalRef (h); + IntPtrEnv.Handles.DeleteLocalRef (h); + return new Exception ("yada yada yada"); + } + } +} + +class App { + const string LibraryName = "jvm.dll"; + + [DllImport (LibraryName)] + static extern int JNI_CreateJavaVM (out IntPtr javavm, out IntPtr jnienv, ref JavaVMInitArgs args); + + public static void Main () + { + IntPtr _jvm, _env; + CreateJavaVM (out _jvm, out _env); + Console.WriteLine ("# _jvm: {0}", _jvm.ToString ("x")); + Console.WriteLine ("# _env: {0}", _env.ToString ("x")); + + SafeTiming (_env); + IntPtrTiming (_env); + } + + static void CreateJavaVM (out IntPtr jvm, out IntPtr jnienv) + { + var args = new JavaVMInitArgs () { + version = JniVersion.v1_6, + nOptions = 0, + ignoreUnrecognized = (byte) 1, + }; + int r = JNI_CreateJavaVM (out jvm, out jnienv, ref args); + if (r != 0) + throw new InvalidOperationException ("JNI_CreateJavaVM returned: " + r); + } + + const int C = 10000000; + + static unsafe void SafeTiming (IntPtr _env) + { + var se = new SafeEnv (_env); + var Arrays_class = SafeEnv.Types.FindClass ("java/util/Arrays"); + var Arrays_binarySearch = SafeEnv.Members.GetStaticMethodID (Arrays_class, "binarySearch", "([II)I"); + var intArray = SafeEnv.Arrays.NewIntArray (3); + fixed (int* p = new int[]{1,2,3}) + SafeEnv.Arrays.SetIntArrayRegion (intArray, 0, 3, (IntPtr) p); + + var t = Stopwatch.StartNew (); + var args = stackalloc JValue [2]; + args [0] = new JValue (intArray); + args [1] = new JValue (2); + for (int i = 0; i < C; ++i) { + if (SafeEnv.Current.SafeHandle.DangerousGetHandle () == IntPtr.Zero) + Console.WriteLine("wat?!"); + int r = SafeEnv.Members.CallStaticIntMethod (Arrays_class, Arrays_binarySearch, args); + } + t.Stop (); + Console.WriteLine ("# SafeHandle timing: {0}", t.Elapsed); + Console.WriteLine ("#\tAverage Invocation: {0}ms", t.Elapsed.TotalMilliseconds / C); + GC.KeepAlive (se); + GC.KeepAlive (intArray); + GC.KeepAlive (Arrays_class); + GC.KeepAlive (Arrays_binarySearch); + } + + static unsafe void IntPtrTiming (IntPtr _env) + { + var pe = new IntPtrEnv (_env); + var Arrays_class = IntPtrEnv.Types.FindClass ("java/util/Arrays"); + var Arrays_binarySearch = IntPtrEnv.Members.GetStaticMethodID (Arrays_class, "binarySearch", "([II)I"); + var intArray = IntPtrEnv.Arrays.NewIntArray (3); + fixed (int* p = new int[]{1,2,3}) + IntPtrEnv.Arrays.SetIntArrayRegion (intArray, 0, 3, (IntPtr) p); + + var t = Stopwatch.StartNew (); + var args = stackalloc JValue [2]; + args [0] = new JValue (intArray); + args [1] = new JValue (2); + for (int i = 0; i < C; ++i) { + int r = IntPtrEnv.Members.CallStaticIntMethod (Arrays_class, Arrays_binarySearch, args); + } + t.Stop (); + Console.WriteLine ("# JniObjectReference timing: {0}", t.Elapsed); + Console.WriteLine ("#\tAverage Invocation: {0}ms", t.Elapsed.TotalMilliseconds / C); + } +} diff --git a/tests/invocation-overhead/test-overheads.exe.config b/tests/invocation-overhead/test-overheads.exe.config new file mode 100644 index 000000000..3d9277004 --- /dev/null +++ b/tests/invocation-overhead/test-overheads.exe.config @@ -0,0 +1,3 @@ + + + diff --git a/tools/jnienv-gen/Generator.cs b/tools/jnienv-gen/Generator.cs index 7383f5c08..38270be55 100644 --- a/tools/jnienv-gen/Generator.cs +++ b/tools/jnienv-gen/Generator.cs @@ -55,28 +55,74 @@ static void GenerateFile (TextWriter o) o.WriteLine ("//"); o.WriteLine ("// To make changes, edit monodroid/tools/jnienv-gen-interop and rerun"); o.WriteLine (); + o.WriteLine ("#if !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine ("#define FEATURE_HANDLES_ARE_SAFE_HANDLES"); + o.WriteLine ("#endif // !FEATURE_HANDLES_ARE_SAFE_HANDLES && !FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine (); + o.WriteLine ("#if FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine ("#define _NAMESPACE_PER_HANDLE"); + o.WriteLine ("#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES && FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine (); o.WriteLine ("using System;"); o.WriteLine ("using System.Linq;"); o.WriteLine ("using System.Runtime.InteropServices;"); o.WriteLine ("using System.Threading;"); o.WriteLine (); - o.WriteLine ("namespace Java.Interop {"); + o.WriteLine ("using Java.Interop;"); o.WriteLine (); - GenerateDelegates (o); + o.WriteLine ("using JNIEnvPtr = System.IntPtr;"); o.WriteLine (); - GenerateTypes (o); + o.WriteLine ("#if FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine ("\tusing jinstanceFieldID = System.IntPtr;"); + o.WriteLine ("\tusing jstaticFieldID = System.IntPtr;"); + o.WriteLine ("\tusing jinstanceMethodID = System.IntPtr;"); + o.WriteLine ("\tusing jstaticMethodID = System.IntPtr;"); + o.WriteLine ("\tusing jobject = System.IntPtr;"); + o.WriteLine ("#endif // FEATURE_HANDLES_ARE_INTPTRS"); o.WriteLine (); + o.WriteLine ("namespace Java.Interop {"); GenerateJniNativeInterface (o); + o.WriteLine ("}"); + o.WriteLine ("#if FEATURE_HANDLES_ARE_SAFE_HANDLES"); + o.WriteLine ("namespace"); + o.WriteLine ("#if _NAMESPACE_PER_HANDLE"); + o.WriteLine ("\tJava.Interop.SafeHandles"); + o.WriteLine ("#else"); + o.WriteLine ("\tJava.Interop"); + o.WriteLine ("#endif"); + o.WriteLine ("{"); o.WriteLine (); - GenerateJniNativeInterfaceInvoker (o); - // GenerateJniNativeInterfaceInvoker2 (o); + GenerateDelegates (o, HandleStyle.SafeHandle); + o.WriteLine (); + GenerateTypes (o, HandleStyle.SafeHandle); + o.WriteLine (); + GenerateJniNativeInterfaceInvoker (o, HandleStyle.SafeHandle); o.WriteLine ("}"); + o.WriteLine ("#endif // FEATURE_HANDLES_ARE_SAFE_HANDLES"); + o.WriteLine ("#if FEATURE_HANDLES_ARE_INTPTRS"); + o.WriteLine ("namespace"); + o.WriteLine ("#if _NAMESPACE_PER_HANDLE"); + o.WriteLine ("\tJava.Interop.IntPtrs"); + o.WriteLine ("#else"); + o.WriteLine ("\tJava.Interop"); + o.WriteLine ("#endif"); + o.WriteLine ("{"); + o.WriteLine (); + GenerateDelegates (o, HandleStyle.IntPtr); + o.WriteLine (); + GenerateTypes (o, HandleStyle.IntPtr); + o.WriteLine (); + GenerateJniNativeInterfaceInvoker (o, HandleStyle.IntPtr); + o.WriteLine ("}"); + o.WriteLine ("#endif // FEATURE_HANDLES_ARE_INTPTRS"); + // GenerateJniNativeInterfaceInvoker2 (o); } - static void GenerateDelegates (TextWriter o) + static void GenerateDelegates (TextWriter o, HandleStyle style) { + created_delegates = new HashSet (); foreach (var e in JNIEnvEntries) { - CreateDelegate (o, e); + CreateDelegate (o, e, style); } } @@ -102,12 +148,13 @@ static void GenerateJniNativeInterface (TextWriter o) o.WriteLine ("\t}"); } - static string Initialize (JniFunction e, string prefix) + static string Initialize (JniFunction e, string prefix, string delegateType) { - return string.Format ("{2}{0} = ({1}) Marshal.GetDelegateForFunctionPointer (env.{0}, typeof ({1}));", e.Name, e.Delegate, prefix); + return string.Format ("{0}{1} = ({2}) Marshal.GetDelegateForFunctionPointer (env.{1}, typeof ({2}));", + prefix, e.Name, delegateType); } - static void GenerateJniNativeInterfaceInvoker (TextWriter o) + static void GenerateJniNativeInterfaceInvoker (TextWriter o, HandleStyle style) { o.WriteLine ("\tpartial class JniEnvironmentInvoker {"); o.WriteLine (); @@ -118,27 +165,29 @@ static void GenerateJniNativeInterfaceInvoker (TextWriter o) o.WriteLine ("\t\t\tenv = *p;"); foreach (var e in JNIEnvEntries) { - if (e.Delegate == null) - continue; if (!e.Prebind) continue; - o.WriteLine ("\t\t\t{0}", Initialize (e, "")); + var d = e.GetDelegateTypeName (style); + if (e.GetDelegateTypeName (style) == null) + continue; + o.WriteLine ("\t\t\t{0}", Initialize (e, "", d)); } o.WriteLine ("\t\t}"); o.WriteLine (); foreach (var e in JNIEnvEntries) { - if (e.Delegate == null) + var d = e.GetDelegateTypeName (style); + if (d == null) continue; o.WriteLine (); if (e.Prebind) - o.WriteLine ("\t\tpublic readonly {0} {1};\n", e.Delegate, e.Name); + o.WriteLine ("\t\tpublic readonly {0} {1};\n", d, e.Name); else { - o.WriteLine ("\t\t{0} _{1};", e.Delegate, e.Name); - o.WriteLine ("\t\tpublic {0} {1} {{", e.Delegate, e.Name); + o.WriteLine ("\t\t{0} _{1};", d, e.Name); + o.WriteLine ("\t\tpublic {0} {1} {{", d, e.Name); o.WriteLine ("\t\t\tget {"); - o.WriteLine ("\t\t\t\tif (_{0} == null)\n\t\t\t\t\t{1}", e.Name, Initialize (e, "_")); + o.WriteLine ("\t\t\t\tif (_{0} == null)\n\t\t\t\t\t{1}", e.Name, Initialize (e, "_", d)); o.WriteLine ("\t\t\t\treturn _{0};\n\t\t\t}}", e.Name); o.WriteLine ("\t\t}"); } @@ -150,30 +199,32 @@ static void GenerateJniNativeInterfaceInvoker (TextWriter o) static HashSet created_delegates = new HashSet (); - static void CreateDelegate (TextWriter o, JniFunction entry) + static void CreateDelegate (TextWriter o, JniFunction entry, HandleStyle style) { StringBuilder builder = new StringBuilder (); bool has_char_array = false; - string name = entry.GetDelegateTypeName (entry.Name); + string name = entry.GetDelegateTypeName (style); if (name == null) return; - builder.AppendFormat ("\tunsafe delegate {0} {1} (JniEnvironmentSafeHandle env", entry.GetReturnType (entry.Name), name); + builder.AppendFormat ("\tunsafe delegate {0} {1} ({2} env", entry.GetMarshalReturnType (style), name, GetJniEnvironmentPointerType (style)); for (int i = 0; i < entry.Parameters.Length; i++) { if (i >= 0) { builder.Append (", "); - builder.AppendFormat ("{0} {1}", entry.Parameters [i].Type.ManagedType, entry.Parameters [i].Name); + builder.AppendFormat ("{0} {1}", + entry.Parameters [i].Type.GetMarshalType (style, isReturn: false), + entry.Parameters [i].Name); } - if (entry.Parameters [i].Type.ManagedType == "va_list") + var ptype = entry.Parameters [i].Type.GetManagedType (style, isReturn: false); + if (ptype == "va_list") return; - if (entry.Parameters [i].Type.ManagedType == "char[]") + if (ptype == "char[]") has_char_array = true; } builder.Append (");"); - entry.Delegate = name; if (created_delegates.Contains (name)) return; @@ -183,7 +234,18 @@ static void CreateDelegate (TextWriter o, JniFunction entry) o.WriteLine (builder.ToString ()); } - static void GenerateTypes (TextWriter o) + static string GetJniEnvironmentPointerType (HandleStyle style) + { + switch (style) { + case HandleStyle.SafeHandle: + return "JNIEnvPtr"; + case HandleStyle.IntPtr: + return "JNIEnvPtr"; + } + return null; + } + + static void GenerateTypes (TextWriter o, HandleStyle style) { var visibilities = new Dictionary { { "Arrays", "public" }, @@ -201,12 +263,12 @@ static void GenerateTypes (TextWriter o) string visibility; if (!visibilities.TryGetValue (t, out visibility)) visibility = "internal"; - GenerateJniEnv (o, t, visibility); + GenerateJniEnv (o, t, visibility, style); } o.WriteLine ("\t}"); } - static void GenerateJniEnv (TextWriter o, string type, string visibility) + static void GenerateJniEnv (TextWriter o, string type, string visibility, HandleStyle style) { o.WriteLine (); o.WriteLine ("\t{0} static partial class {1} {{", visibility, type); @@ -219,34 +281,37 @@ static void GenerateJniEnv (TextWriter o, string type, string visibility) continue; o.WriteLine (); - o.Write ("\t\t{2} static unsafe {0} {1} (", entry.GetReturnType(entry.Name), entry.ApiName, entry.Visibility); + o.Write ("\t\t{2} static unsafe {0} {1} (", entry.GetManagedReturnType (style), entry.ApiName, entry.Visibility); switch (entry.ApiName) { default: - bool is_void = entry.ReturnType.ManagedType == "void"; + bool is_void = entry.ReturnType.JniType == "void"; for (int i = 0; i < entry.Parameters.Length; i++) { if (i > 0) o.Write (", "); - o.Write ("{0} {1}", entry.Parameters [i].Type.ManagedType, Escape (entry.Parameters [i].Name)); + o.Write ("{0} {1}", entry.Parameters [i].Type.GetManagedType (style, isReturn: false), Escape (entry.Parameters [i].Name)); } o.WriteLine (")"); o.WriteLine ("\t\t{"); - NullCheckParameters (o, entry.Parameters); + NullCheckParameters (o, entry.Parameters, style); o.Write ("\t\t\t"); if (!is_void) - o.Write ("var tmp = ", entry.ReturnType.GetManagedType (isReturn:true)); - o.Write ("JniEnvironment.Current.Invoker.{0} (JniEnvironment.Current.SafeHandle", entry.Name); + o.Write ("var tmp = "); + o.Write ("JniEnvironment.Current.Invoker.{0} (JniEnvironment.Current.EnvironmentPointer", entry.Name); for (int i = 0; i < entry.Parameters.Length; i++) { + var p = entry.Parameters [i]; o.Write (", "); - if (entry.Parameters [i].Type.ManagedType.StartsWith ("out ")) + if (p.Type.GetManagedType (style, isReturn: false).StartsWith ("out ", StringComparison.Ordinal)) o.Write ("out "); - o.Write (Escape (entry.Parameters [i].Name)); + o.Write (p.Type.GetManagedToMarshalExpression (style, Escape (entry.Parameters [i].Name))); } o.WriteLine (");"); RaiseException (o, entry); if (is_void) { } else { - LogHandleCreation (o, entry, "tmp", "\t\t\t"); - o.WriteLine ("\t\t\treturn tmp;"); + foreach (var line in entry.ReturnType.GetHandleCreationLogStatements (style, entry.Name, "tmp")) + o.WriteLine ("\t\t\t{0}", line); + foreach (var line in entry.ReturnType.GetMarshalToManagedStatements (style, "tmp")) + o.WriteLine ("\t\t\t{0}", line); } break; } @@ -255,71 +320,18 @@ static void GenerateJniEnv (TextWriter o, string type, string visibility) } o.WriteLine ("\t}"); } - - static JniFunction GetArrayCopy (JniFunction entry) - { - JniFunction r = null; - int c = 0; - var es = JNIEnvEntries.Where (e => e.Name.StartsWith ("Get") && e.Name.EndsWith ("ArrayRegion") && - e.Parameters [0].Type.Type == entry.ReturnType.Type); - foreach (var e in es) - { - r = e; - c++; - } - if (c > 1) { - string s = string.Format ("# Couldn't find matching array copy method! Candidates: {0}", - string.Join (", ", es.Select(e => e.Name))); - throw new InvalidOperationException (s); - } - if (c == 0) - throw new InvalidOperationException ("Couldn't find matching array copy method for " + entry.Name + ". No candidates found."); - return r; - } - - static void LogHandleCreation (TextWriter o, JniFunction entry, string variable, string indent) - { - string rt = entry.GetReturnType (entry.Name); - switch (rt) { - case "JniLocalReference": - if (entry.Name == "NewLocalRef" || entry.Name == "ExceptionOccurred") - break; - o.Write (indent); - o.WriteLine ("JniEnvironment.Current.LogCreateLocalRef ({0});", - variable); - break; - } - } - - static void NullCheckParameters (TextWriter o, ParamInfo[] ps) + static void NullCheckParameters (TextWriter o, ParamInfo[] ps, HandleStyle style) { bool haveChecks = false; for (int i = 0; i < ps.Length; i++) { var p = ps [i]; if (p.CanBeNull) continue; - if (p.Type.ManagedType == "IntPtr") { - haveChecks = true; - o.WriteLine ("\t\t\tif ({0} == IntPtr.Zero)", Escape (p.Name), p.Type.ManagedType); - o.WriteLine ("\t\t\t\tthrow new ArgumentException (\"'{0}' must not be IntPtr.Zero.\", \"{0}\");", Escape (p.Name)); - continue; - } - var t = p.Type.GetManagedType (isReturn:false); - if (t == "string") { - haveChecks = true; - o.WriteLine ("\t\t\tif ({0} == null)", Escape (p.Name), p.Type.ManagedType); - o.WriteLine ("\t\t\t\tthrow new ArgumentNullException (\"{0}\");", Escape (p.Name)); - continue; - } - if (t == "JniReferenceSafeHandle" || - (t.StartsWith ("Jni") && t.EndsWith ("ID"))) { - haveChecks = true; - o.WriteLine ("\t\t\tif ({0} == null)", Escape (p.Name), p.Type.ManagedType); - o.WriteLine ("\t\t\t\tthrow new ArgumentNullException (\"{0}\");", Escape (p.Name)); - o.WriteLine ("\t\t\tif ({0}.IsInvalid)", Escape (p.Name), p.Type.ManagedType); - o.WriteLine ("\t\t\t\tthrow new ArgumentException (\"{0}\");", Escape (p.Name)); - continue; + var pn = Escape (p.Name); + foreach (var line in p.Type.VerifyParameter (style, pn)) { + haveChecks = true; + o.WriteLine ("\t\t\t{0}", line); } } if (haveChecks) @@ -370,54 +382,6 @@ public string ApiName // If the JNI function can throw an exception (ExceptionOccurred needs to be invoked) public bool Throws; - // The signature of the C# delegate that we will use for the generated property - private string @delegate; - public string Delegate - { - get - { - StringBuilder d; - - if (@delegate != null) - return @delegate; - - if (Parameters == null) - return null; - - if (IsPrivate) - return null; - - d = new StringBuilder (); - bool is_void = ReturnType.Type == "void"; - - if (is_void) { - d.Append ("Action"); - - return d.ToString (); - } - set - { - @delegate = value; - } - } - private string visibility; public string Visibility { get { @@ -433,34 +397,38 @@ public string Visibility { public bool IsPublic { get { return Visibility == "public"; } } public bool IsPrivate { get { return visibility == "private"; } } - public string GetReturnType (string methodName) + public string GetManagedReturnType (HandleStyle style) { - if (ReturnType == null || ReturnType.ManagedType == "void") + if (ReturnType == null) return "void"; - if (methodName == "NewGlobalRef") - return "JniGlobalReference"; - if (methodName == "NewWeakGlobalRef") - return "JniWeakGlobalReference"; - return ReturnType.GetManagedType (isReturn:true).FixupType (); + return ReturnType.GetManagedType (style, isReturn:true); + } + + public string GetMarshalReturnType (HandleStyle style) + { + if (ReturnType == null) + return "void"; + return ReturnType.GetMarshalType (style, isReturn:true); } - public string GetDelegateTypeName (string methodName) + public string GetDelegateTypeName (HandleStyle style) { StringBuilder name = new StringBuilder (); - if (ReturnType == null || ReturnType.ManagedType == "void") + if (ReturnType == null || ReturnType.JniType == "void") name.Append ("JniAction_"); else name.Append ("JniFunc_"); - name.Append ("JniEnvironmentSafeHandle"); + name.Append ("JNIEnvPtr"); for (int i = 0; i < Parameters.Length; i++) { - if (Parameters [i].Type.ManagedType == "va_list") + var pt = Parameters [i].Type.GetMarshalType (style, isReturn: false); + if (pt == "va_list") return null; - name.AppendFormat ("_").Append (Parameters [i].Type.GetManagedType (isReturn:false).FixupType ()); + name.AppendFormat ("_").Append (pt.FixupType ()); } - string rt = GetReturnType (methodName); + string rt = GetMarshalReturnType (style); if (rt != "void") name.Append ("_").Append (rt); @@ -468,71 +436,372 @@ public string GetDelegateTypeName (string methodName) } } - class TypeInfo + abstract class TypeInfo { - public string Type; - - private string managed_type; - public string ManagedType - { - get { return managed_type ?? GetManagedType (Type, false); } - set { managed_type = value; } - } - - public string GetManagedType (string native_type = null, bool isReturn = false) - { - native_type = native_type ?? managed_type ?? Type; - switch (native_type) { - case "jvalue*": return "JValue*"; - case "jbyte": return "sbyte"; - case "jchar": return "char"; - case "jchar*": return "IntPtr"; - case "jshort": return "short"; - case "jsize": - case "jint": return "int"; - case "jlong": return "long"; - case "jfloat": return "float"; - case "jdouble": return "double"; - case "jboolean": return "bool"; - case "": return "void"; - case "void*": return "IntPtr"; - case "jfieldID": return "JniInstanceFieldID"; - case "jstaticfieldID": return "JniStaticFieldID"; - case "jmethodID": return "JniInstanceMethodID"; - case "jstaticmethodID": return "JniStaticMethodID"; - case "jstring": - case "jarray": - case "jobject": - case "jthrowable": - case "jclass": return isReturn ? "JniLocalReference" : "JniReferenceSafeHandle"; - case "jweak": return "JniWeakGlobalReference"; - case "const jchar*": - case "const char*": return "string"; - case "JavaVM**": return "out JavaVMSafeHandle"; - case "const JNINativeMethod*": return "JniNativeMethodRegistration []"; - case "jobjectRefType": return "JniReferenceType"; - default: - if (native_type.EndsWith ("Array")) - return isReturn ? "JniLocalReference" : "JniReferenceSafeHandle"; - if (native_type.EndsWith ("*")) - return "IntPtr"; - return native_type; + static readonly Dictionary types = new Dictionary () { + { "jvalue*", new BuiltinTypeInfo ("jvalue*", "JValue*") }, + { "jbyte", new BuiltinTypeInfo ("jbyte", "sbyte") }, + { "jchar", new BuiltinTypeInfo ("jchar", "char") }, + { "jchar*", new BuiltinTypeInfo ("jchar*", "IntPtr") }, + { "jshort", new BuiltinTypeInfo ("jshort", "short") }, + { "jsize", new BuiltinTypeInfo ("jsize", "int") }, + { "jint", new BuiltinTypeInfo ("jint", "int") }, + { "jlong", new BuiltinTypeInfo ("jlong", "long") }, + { "jfloat", new BuiltinTypeInfo ("jfloat", "float") }, + { "jdouble", new BuiltinTypeInfo ("jdouble", "double") }, + { "jboolean", new BuiltinTypeInfo ("jboolean", "bool") }, + { "", new BuiltinTypeInfo ("", "void") }, + { "void*", new BuiltinTypeInfo ("void*", "IntPtr") }, + { "const jchar*", new StringTypeInfo ("const jchar*") }, + { "const char*", new StringTypeInfo ("const char*") }, + { "const JNINativeMethod*", new BuiltinTypeInfo ("const JNINativeMethod*", "JniNativeMethodRegistration []") }, + { "jobjectRefType", new BuiltinTypeInfo ("jobjectRefType", "JniObjectReferenceType") }, + { "jfieldID", new InstanceFieldTypeInfo ("jfieldID") }, + { "jstaticfieldID", new StaticFieldTypeInfo ("jstaticfieldID") }, + { "jmethodID", new InstanceMethodTypeInfo ("jmethodID") }, + { "jstaticmethodID", new StaticMethodTypeInfo ("jstaticmethodID") }, + { "jstring", new LocalReferenceTypeInfo ("jstring") }, + { "jarray", new LocalReferenceTypeInfo ("jarray") }, + { "jobject", new LocalReferenceTypeInfo ("jobject") }, + { "jthrowable", new LocalReferenceTypeInfo ("jthrowable") }, + { "jclass", new LocalReferenceTypeInfo ("jclass") }, + { "jweak", new WeakGlobalReferenceTypeInfo ("jweak") }, + { "jglobal", new GlobalReferenceTypeInfo ("jglobal") }, + { "JavaVM**", new JavaVMPointerTypeInfo ("JavaVM**") }, + }; + + public static TypeInfo Create (string type, string managedType = null) + { + if (managedType != null) + return new BuiltinTypeInfo (type, managedType); + TypeInfo t; + if (types.TryGetValue (type, out t)) + return t; + if (type.EndsWith ("Array", StringComparison.Ordinal)) + return new ArrayTypeInfo (type); + if (type.EndsWith ("*", StringComparison.Ordinal)) + return new BuiltinTypeInfo (type, "IntPtr"); + return new BuiltinTypeInfo (type, type); + } + + public static implicit operator TypeInfo (string jniType) + { + return Create (jniType); + } + + public readonly string JniType; + + protected TypeInfo (string jniType) + { + JniType = jniType; + } + + public abstract string GetMarshalType (HandleStyle style, bool isReturn); + public abstract string GetManagedType (HandleStyle style, bool isReturn); + + public virtual string[] GetHandleCreationLogStatements (HandleStyle style, string method, string variable) + { + return new string [0]; + } + + public virtual string GetManagedToMarshalExpression (HandleStyle style, string variable) + { + return variable; + } + + public virtual string[] GetMarshalToManagedStatements (HandleStyle style, string variable) + { + return new[] { + string.Format ("return {0};", variable), + }; + } + + public virtual string[] VerifyParameter (HandleStyle style, string variable) + { + return new string [0]; + } + } + + class BuiltinTypeInfo : TypeInfo { + + string managed; + + public BuiltinTypeInfo (string jni, string managed) + : base (jni) + { + this.managed = managed; + } + + public override string GetMarshalType (HandleStyle style, bool isReturn) + { + return managed; + } + + public override string GetManagedType (HandleStyle style, bool isReturn) + { + return managed; + } + + public override string[] VerifyParameter (HandleStyle style, string variable) + { + if (managed != "IntPtr") + return new string [0]; + return new[] { + string.Format ("if ({0} == IntPtr.Zero)", variable), + string.Format ("\tthrow new ArgumentException (\"'{0}' must not be IntPtr.Zero.\", \"{0}\");", variable), + }; + } + } + + class StringTypeInfo : TypeInfo { + + public StringTypeInfo (string jni) + : base (jni) + { + } + + public override string GetMarshalType (HandleStyle style, bool isReturn) + { + return "string"; + } + + public override string GetManagedType (HandleStyle style, bool isReturn) + { + return "string"; + } + + public override string[] GetMarshalToManagedStatements (HandleStyle style, string variable) + { + switch (style) { + case HandleStyle.SafeHandle: + return new [] { + string.Format ("JniEnvironment.Current.LogCreateLocalRef ({0});", variable), + string.Format ("return {0};", variable), + }; + case HandleStyle.IntPtr: + return new [] { + string.Format ("JniEnvironment.Current.LogCreateLocalRef ({0});", variable), + string.Format ("return new JniObjectReference ({0}, JniObjectReferenceType.Local);", variable), + }; } + return null; + } + + public override string[] VerifyParameter (HandleStyle style, string variable) + { + return new[] { + string.Format ("if ({0} == null)", variable), + string.Format ("\tthrow new ArgumentNullException (\"{0}\");", variable), + }; } + } - public TypeInfo () + class ArrayTypeInfo : LocalReferenceTypeInfo { + + public ArrayTypeInfo (string jni) + : base (jni) { } + } - public TypeInfo (string Type, string ManagedType = null) + class IdTypeInfo : TypeInfo { + + string type; + + public IdTypeInfo (string jni, string type) + : base (jni) { - this.Type = Type; - this.ManagedType = ManagedType; + this.type = type; } - public static implicit operator TypeInfo (string type) + public override string GetMarshalType (HandleStyle style, bool isReturn) + { + return "IntPtr"; + } + + public override string GetManagedType (HandleStyle style, bool isReturn) + { + return type; + } + + public override string GetManagedToMarshalExpression (HandleStyle style, string variable) + { + return string.Format ("{0}.ID", variable); + } + + public override string[] VerifyParameter (HandleStyle style, string variable) + { + return new [] { + string.Format ("if ({0} == null)", variable), + string.Format ("\tthrow new ArgumentNullException (\"{0}\");", variable), + string.Format ("if ({0}.ID == IntPtr.Zero)", variable), + string.Format ("\tthrow new ArgumentException (\"Handle value cannot be null.\", \"{0}\");", variable), + }; + } + + public override string[] GetMarshalToManagedStatements (HandleStyle style, string variable) + { + return new[] { + string.Format ("if ({0} == IntPtr.Zero)", variable), + string.Format ("\treturn null;"), + string.Format ("return new {0} ({1});", type, variable), + }; + } + } + + class InstanceFieldTypeInfo : IdTypeInfo { + + public InstanceFieldTypeInfo (string jni) + : base (jni, "JniInstanceFieldID") + { + } + } + + class InstanceMethodTypeInfo : IdTypeInfo { + + public InstanceMethodTypeInfo (string jni) + : base (jni, "JniInstanceMethodID") + { + } + } + + class StaticFieldTypeInfo : IdTypeInfo { + + public StaticFieldTypeInfo (string jni) + : base (jni, "JniStaticFieldID") { - return new TypeInfo (type); + } + } + + class StaticMethodTypeInfo : IdTypeInfo { + + public StaticMethodTypeInfo (string jni) + : base (jni, "JniStaticMethodID") + { + } + } + + abstract class ObjectReferenceTypeInfo : TypeInfo { + + string safeType, refType; + + public ObjectReferenceTypeInfo (string jni, string safeType, string refType) + : base (jni) + { + this.safeType = safeType; + this.refType = refType; + } + + public override string GetMarshalType (HandleStyle style, bool isReturn) + { + switch (style) { + case HandleStyle.SafeHandle: + return isReturn ? safeType : "JniReferenceSafeHandle"; + case HandleStyle.IntPtr: + return "jobject"; + } + return null; + } + + public override string GetManagedType (HandleStyle style, bool isReturn) + { + return "JniObjectReference"; + } + + public override string GetManagedToMarshalExpression (HandleStyle style, string variable) + { + switch (style) { + case HandleStyle.SafeHandle: + return string.Format ("{0}.SafeHandle", variable); + case HandleStyle.IntPtr: + return string.Format ("{0}.Handle", variable); + } + return null; + } + + public override string[] GetMarshalToManagedStatements (HandleStyle style, string variable) + { + switch (style) { + case HandleStyle.SafeHandle: + return new [] { + string.Format ("return new JniObjectReference ({0}, {1});", variable, refType), + }; + case HandleStyle.IntPtr: + return new [] { + string.Format ("return new JniObjectReference ({0}, {1});", variable, refType), + }; + } + return null; + } + + public override string[] VerifyParameter (HandleStyle style, string variable) + { + switch (style) { + case HandleStyle.SafeHandle: + return new [] { + string.Format ("if ({0}.SafeHandle == null)", variable), + string.Format ("\tthrow new ArgumentNullException (\"{0}\");", variable), + string.Format ("if ({0}.SafeHandle.IsInvalid)", variable), + string.Format ("\tthrow new ArgumentException (\"{0}\");", variable), + }; + case HandleStyle.IntPtr: + return new [] { + string.Format ("if ({0}.Handle == IntPtr.Zero)", variable), + string.Format ("\tthrow new ArgumentException (\"`{0}` must not be IntPtr.Zero.\", \"{0}\");", variable), + }; + } + return new string [0]; + } + } + + class LocalReferenceTypeInfo : ObjectReferenceTypeInfo { + + public LocalReferenceTypeInfo (string jni) + : base (jni, "JniLocalReference", "JniObjectReferenceType.Local") + { + } + + public override string[] GetHandleCreationLogStatements (HandleStyle style, string method, string variable) + { + if (method == "NewLocalRef" || method == "ExceptionOccurred") + return base.GetHandleCreationLogStatements (style, method, variable); + return new[] { + string.Format ("JniEnvironment.Current.LogCreateLocalRef ({0});", variable), + }; + } + } + + class WeakGlobalReferenceTypeInfo : ObjectReferenceTypeInfo { + + public WeakGlobalReferenceTypeInfo (string jni) + : base (jni, "JniWeakGlobalReference", "JniObjectReferenceType.WeakGlobal") + { + } + } + + class GlobalReferenceTypeInfo : ObjectReferenceTypeInfo { + + public GlobalReferenceTypeInfo (string jni) + : base (jni, "JniGlobalReference", "JniObjectReferenceType.Global") + { + } + } + + class JavaVMPointerTypeInfo : TypeInfo { + + public JavaVMPointerTypeInfo (string jni) + : base (jni) + { + } + + public override string GetMarshalType (HandleStyle style, bool isReturn) + { + return "out IntPtr"; + } + + public override string GetManagedType (HandleStyle style, bool isReturn) + { + return "out IntPtr"; } } @@ -565,5 +834,10 @@ enum Modifier { Params = 1, CanBeNull = 2, } + + enum HandleStyle { + SafeHandle, + IntPtr, + } } diff --git a/tools/jnienv-gen/Generator.g.cs b/tools/jnienv-gen/Generator.g.cs index 2861f4d16..5a6484fcb 100644 --- a/tools/jnienv-gen/Generator.g.cs +++ b/tools/jnienv-gen/Generator.g.cs @@ -8,7 +8,7 @@ partial class Generator Name = "GetVersion", Visibility = "internal", Prototype = "jint (*GetVersion)(JNIEnv*);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {}, }, new JniFunction { @@ -17,7 +17,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jclass (*DefineClass)(JNIEnv*, const char, jobject, const jbyte*, jsize);", - ReturnType = new TypeInfo ("JniLocalReference"), + ReturnType = "jclass", Parameters = new ParamInfo [] {new ParamInfo ("const char*", "name"), new ParamInfo ("jobject", "loader"), new ParamInfo ("const jbyte*", "buf"), new ParamInfo ("jsize", "bufLen")}, }, new JniFunction { @@ -26,7 +26,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jclass (*FindClass)(JNIEnv*, const char*);", - ReturnType = new TypeInfo ("JniLocalReference"), + ReturnType = "jclass", Parameters = new ParamInfo [] {new ParamInfo ("const char*", "classname")}, }, new JniFunction { @@ -34,7 +34,7 @@ partial class Generator Name = "FromReflectedMethod", Visibility = "private", Prototype = "jmethodID (*FromReflectedMethod)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jmethodID"), + ReturnType = "jmethodID", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "method")}, }, new JniFunction { @@ -42,7 +42,7 @@ partial class Generator Name = "FromReflectedField", Visibility = "private", Prototype = "jfieldID (*FromReflectedField)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jfieldID"), + ReturnType = "jfieldID", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "field")}, }, new JniFunction { @@ -50,7 +50,7 @@ partial class Generator Name = "ToReflectedMethod", Visibility = "internal", Prototype = "jobject (*ToReflectedMethod)(JNIEnv*, jclass, jmethodID, jboolean);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "cls"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jboolean", "isStatic")}, }, new JniFunction { @@ -58,7 +58,7 @@ partial class Generator Name = "GetSuperclass", Visibility = "public", Prototype = "jclass (*GetSuperclass)(JNIEnv*, jclass);", - ReturnType = new TypeInfo ("jclass"), + ReturnType = "jclass", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass")}, }, new JniFunction { @@ -66,7 +66,7 @@ partial class Generator Name = "IsAssignableFrom", Visibility = "public", Prototype = "jboolean (*IsAssignableFrom)(JNIEnv*, jclass, jclass);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "clazz1"), new ParamInfo ("jclass", "clazz2")}, }, new JniFunction { @@ -74,7 +74,7 @@ partial class Generator Name = "ToReflectedField", Visibility = "internal", Prototype = "jobject (*ToReflectedField)(JNIEnv*, jclass, jfieldID, jboolean);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "cls"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jboolean", "isStatic")}, }, new JniFunction { @@ -84,7 +84,7 @@ partial class Generator Visibility = "public", // Throws = true, Prototype = "jint (*Throw)(JNIEnv*, jthrowable);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jthrowable", "obj")}, }, new JniFunction { @@ -94,7 +94,7 @@ partial class Generator Visibility = "public", // Throws = true, Prototype = "jint (*ThrowNew)(JNIEnv*, jclass, const char*);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "clazz"), new ParamInfo ("const char*", "message")}, }, new JniFunction { @@ -102,7 +102,7 @@ partial class Generator Name = "ExceptionOccurred", Visibility = "internal", Prototype = "jthrowable (*ExceptionOccurred)(JNIEnv*);", - ReturnType = new TypeInfo ("jthrowable"), + ReturnType = "jthrowable", Parameters = new ParamInfo [] {}, }, new JniFunction { @@ -110,7 +110,7 @@ partial class Generator Name = "ExceptionDescribe", Visibility = "internal", Prototype = "void (*ExceptionDescribe)(JNIEnv*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {}, }, new JniFunction { @@ -118,7 +118,7 @@ partial class Generator Name = "ExceptionClear", Visibility = "internal", Prototype = "void (*ExceptionClear)(JNIEnv*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {}, }, new JniFunction { @@ -126,7 +126,7 @@ partial class Generator Name = "FatalError", Visibility = "public", Prototype = "void (*FatalError)(JNIEnv*, const char*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("const char*", "msg")}, }, new JniFunction { @@ -135,7 +135,7 @@ partial class Generator // CustomWrapper = true, Visibility = "public", Prototype = "jint (*PushLocalFrame)(JNIEnv*, jint);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jint", "capacity")}, }, new JniFunction { @@ -143,7 +143,7 @@ partial class Generator Name = "PopLocalFrame", Visibility = "public", Prototype = "jobject (*PopLocalFrame)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "result", Modifier.CanBeNull)}, }, new JniFunction { @@ -153,7 +153,7 @@ partial class Generator Visibility = "internal", // Prebind = true, Prototype = "jobject (*NewGlobalRef)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jglobal", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -162,7 +162,7 @@ partial class Generator ApiName = "DeleteGlobalRef", Visibility = "internal", Prototype = "void (*DeleteGlobalRef)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("IntPtr", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -172,7 +172,7 @@ partial class Generator Visibility = "internal", // Prebind = true, Prototype = "void (*DeleteLocalRef)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("IntPtr", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -180,7 +180,7 @@ partial class Generator Name = "IsSameObject", Visibility = "public", Prototype = "jboolean (*IsSameObject)(JNIEnv*, jobject, jobject);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "ref1", Modifier.CanBeNull), new ParamInfo ("jobject", "ref2", Modifier.CanBeNull)}, }, new JniFunction { @@ -189,7 +189,7 @@ partial class Generator ApiName = "NewLocalRef", Visibility = "internal", Prototype = "jobject (*NewLocalRef)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -198,7 +198,7 @@ partial class Generator // CustomWrapper = true, Visibility = "public", Prototype = "jint (*EnsureLocalCapacity)(JNIEnv*, jint);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jint", "capacity")}, }, new JniFunction { @@ -207,7 +207,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobject (*AllocObject)(JNIEnv*, jclass);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass")}, }, new JniFunction { @@ -216,7 +216,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobject (*NewObject)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -225,7 +225,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jobject (*NewObjectV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -235,7 +235,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobject (*NewObjectA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -243,7 +243,7 @@ partial class Generator Name = "GetObjectClass", Visibility = "public", Prototype = "jclass (*GetObjectClass)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jclass"), + ReturnType = "jclass", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject")}, }, new JniFunction { @@ -251,7 +251,7 @@ partial class Generator Name = "IsInstanceOf", Visibility = "public", Prototype = "jboolean (*IsInstanceOf)(JNIEnv*, jobject, jclass);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "clazz")}, }, new JniFunction { @@ -260,7 +260,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jmethodID (*GetMethodID)(JNIEnv*, jclass, const char*, const char*);", - ReturnType = new TypeInfo ("jmethodID"), + ReturnType = "jmethodID", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "kls"), new ParamInfo ("const char*", "name"), new ParamInfo ("const char*", "signature")}, }, new JniFunction { @@ -269,7 +269,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jobject (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -278,7 +278,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jobject (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -288,7 +288,7 @@ partial class Generator Throws = true, Visibility = "internal", Prototype = "jobject (*CallObjectMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -297,7 +297,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallBooleanMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -306,7 +306,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jboolean (*CallBooleanMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -316,7 +316,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallBooleanMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -325,7 +325,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jbyte (*CallByteMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -334,7 +334,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jbyte (*CallByteMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "parms", true)}, }, new JniFunction { @@ -344,7 +344,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jbyte (*CallByteMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -353,7 +353,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallCharMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -362,7 +362,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jchar (*CallCharMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -372,7 +372,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallCharMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -381,7 +381,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallShortMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -390,7 +390,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jshort (*CallShortMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -400,7 +400,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallShortMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -409,7 +409,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallIntMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -418,7 +418,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jint (*CallIntMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -428,7 +428,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallIntMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -437,7 +437,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jlong (*CallLongMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -446,7 +446,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jlong (*CallLongMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -456,7 +456,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jlong (*CallLongMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -465,7 +465,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallFloatMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -474,7 +474,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jfloat (*CallFloatMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -484,7 +484,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallFloatMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -493,7 +493,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallDoubleMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -502,7 +502,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jdouble (*CallDoubleMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -512,7 +512,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallDoubleMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -521,7 +521,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -530,7 +530,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "void (*CallVoidMethodV)(JNIEnv*, jobject, jmethodID, va_list);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -540,7 +540,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallVoidMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -549,7 +549,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jobject (*CallNonvirtualObjectMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -558,7 +558,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jobject (*CallNonvirtualObjectMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jobject"), + ReturnType ="jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -568,7 +568,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jobject (*CallNonvirtualObjectMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -577,7 +577,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallNonvirtualBooleanMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -586,7 +586,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -596,7 +596,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -605,7 +605,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jbyte (*CallNonvirtualByteMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -614,7 +614,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jbyte (*CallNonvirtualByteMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -624,7 +624,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jbyte (*CallNonvirtualSByteMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -633,7 +633,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallNonvirtualCharMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -642,7 +642,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jchar (*CallNonvirtualCharMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -652,7 +652,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallNonvirtualCharMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -661,7 +661,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallNonvirtualShortMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -670,7 +670,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jshort (*CallNonvirtualShortMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -680,7 +680,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallNonvirtualShortMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -689,7 +689,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallNonvirtualIntMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -698,7 +698,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jint (*CallNonvirtualIntMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -708,7 +708,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallNonvirtualIntMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -717,7 +717,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jlong (*CallNonvirtualLongMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -726,7 +726,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jlong (*CallNonvirtualLongMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -736,7 +736,7 @@ partial class Generator Throws = true, Visibility = "internal", Prototype = "jlong (*CallNonvirtualLongMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -745,7 +745,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallNonvirtualFloatMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -754,7 +754,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jfloat (*CallNonvirtualFloatMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -764,7 +764,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallNonvirtualFloatMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -773,7 +773,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallNonvirtualDoubleMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -782,7 +782,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -792,7 +792,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -801,7 +801,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallNonvirtualVoidMethod)(JNIEnv*, jobject, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod")}, }, new JniFunction { @@ -810,7 +810,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "void (*CallNonvirtualVoidMethodV)(JNIEnv*, jobject, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -820,7 +820,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallNonvirtualVoidMethodA)(JNIEnv*, jobject, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jclass", "jclass"), new ParamInfo ("jmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -829,7 +829,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jfieldID (*GetFieldID)(JNIEnv*, jclass, const char*, const char*);", - ReturnType = new TypeInfo ("jfieldID"), + ReturnType = "jfieldID", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("const char*", "name"), new ParamInfo ("const char*", "sig")}, }, new JniFunction { @@ -837,7 +837,7 @@ partial class Generator Name = "GetObjectField", Visibility = "internal", Prototype = "jobject (*GetObjectField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -845,7 +845,7 @@ partial class Generator Name = "GetBooleanField", Visibility = "internal", Prototype = "jboolean (*GetBooleanField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -853,7 +853,7 @@ partial class Generator Name = "GetByteField", Visibility = "internal", Prototype = "jbyte (*GetByteField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -861,7 +861,7 @@ partial class Generator Name = "GetCharField", Visibility = "internal", Prototype = "jchar (*GetCharField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -869,7 +869,7 @@ partial class Generator Name = "GetShortField", Visibility = "internal", Prototype = "jshort (*GetShortField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -877,7 +877,7 @@ partial class Generator Name = "GetIntField", Visibility = "internal", Prototype = "jint (*GetIntField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -885,7 +885,7 @@ partial class Generator Name = "GetLongField", Visibility = "internal", Prototype = "jlong (*GetLongField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -893,7 +893,7 @@ partial class Generator Name = "GetFloatField", Visibility = "internal", Prototype = "jfloat (*GetFloatField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -901,7 +901,7 @@ partial class Generator Name = "GetDoubleField", Visibility = "internal", Prototype = "jdouble (*GetDoubleField)(JNIEnv*, jobject, jfieldID);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID")}, }, new JniFunction { @@ -910,7 +910,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetObjectField)(JNIEnv*, jobject, jfieldID, jobject);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jobject", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -919,7 +919,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetBooleanField)(JNIEnv*, jobject, jfieldID, jboolean);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jboolean", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -928,7 +928,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetByteField)(JNIEnv*, jobject, jfieldID, jbyte);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jbyte", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -937,7 +937,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetCharField)(JNIEnv*, jobject, jfieldID, jchar);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jchar", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -946,7 +946,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetShortField)(JNIEnv*, jobject, jfieldID, jshort);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jshort", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -955,7 +955,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetIntField)(JNIEnv*, jobject, jfieldID, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jint", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -964,7 +964,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetLongField)(JNIEnv*, jobject, jfieldID, jlong);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jlong", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -973,7 +973,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetFloatField)(JNIEnv*, jobject, jfieldID, jfloat);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jfloat", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -982,7 +982,7 @@ partial class Generator ApiName = "SetField", Visibility = "internal", Prototype = "void (*SetDoubleField)(JNIEnv*, jobject, jfieldID, jdouble);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject"), new ParamInfo ("jfieldID", "jfieldID"), new ParamInfo ("jdouble", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -991,7 +991,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jmethodID (*GetStaticMethodID)(JNIEnv*, jclass, const char*, const char*);", - ReturnType = new TypeInfo ("jstaticmethodID"), + ReturnType = "jstaticmethodID", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("const char*", "name"), new ParamInfo ("const char*", "sig")}, }, new JniFunction { @@ -1000,7 +1000,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jobject (*CallStaticObjectMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1009,7 +1009,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jobject (*CallStaticObjectMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "parms", true)}, }, new JniFunction { @@ -1019,7 +1019,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jobject (*CallStaticObjectMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1028,7 +1028,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallStaticBooleanMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1037,7 +1037,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jboolean (*CallStaticBooleanMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1047,7 +1047,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jboolean (*CallStaticBooleanMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1056,7 +1056,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jbyte (*CallStaticByteMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1065,7 +1065,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jbyte (*CallStaticSByteMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1075,7 +1075,7 @@ partial class Generator Throws = true, Visibility = "internal", Prototype = "jbyte (*CallStaticByteMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1084,7 +1084,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallStaticCharMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1093,7 +1093,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jchar (*CallStaticCharMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1103,7 +1103,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jchar (*CallStaticCharMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1112,7 +1112,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallStaticShortMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1121,7 +1121,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jshort (*CallStaticShortMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1131,7 +1131,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jshort (*CallStaticShortMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1140,7 +1140,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallStaticIntMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1149,7 +1149,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jint (*CallStaticIntMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1159,7 +1159,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jint (*CallStaticIntMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1168,7 +1168,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jlong (*CallStaticLongMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1177,7 +1177,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jlong (*CallStaticLongMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1187,7 +1187,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jlong (*CallStaticLongMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1196,7 +1196,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallStaticFloatMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1205,7 +1205,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jfloat (*CallStaticFloatMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1215,7 +1215,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jfloat (*CallStaticFloatMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1224,7 +1224,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallStaticDoubleMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1233,7 +1233,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jdouble (*CallStaticDoubleMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1243,7 +1243,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jdouble (*CallStaticDoubleMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1252,7 +1252,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod")}, }, new JniFunction { @@ -1261,7 +1261,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "void (*CallStaticVoidMethodV)(JNIEnv*, jclass, jmethodID, va_list);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("va_list", "args")}, }, new JniFunction { @@ -1271,7 +1271,7 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*CallStaticVoidMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticmethodID", "jmethod"), new ParamInfo ("jvalue*", "parms", true)}, }, new JniFunction { @@ -1280,7 +1280,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jstaticfieldID (*GetStaticFieldID)(JNIEnv*, jclass, const char*, const char*);", - ReturnType = new TypeInfo ("jstaticfieldID"), + ReturnType = "jstaticfieldID", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("const char*", "name"), new ParamInfo ("const char*", "sig")}, }, new JniFunction { @@ -1288,7 +1288,7 @@ partial class Generator Name = "GetStaticObjectField", Visibility = "internal", Prototype = "jobject (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1296,7 +1296,7 @@ partial class Generator Name = "GetStaticBooleanField", Visibility = "internal", Prototype = "jboolean (*GetStaticBooleanField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1304,7 +1304,7 @@ partial class Generator Name = "GetStaticByteField", Visibility = "internal", Prototype = "jbyte (*GetStaticByteField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jbyte"), + ReturnType = "jbyte", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1312,7 +1312,7 @@ partial class Generator Name = "GetStaticCharField", Visibility = "internal", Prototype = "jchar (*GetStaticCharField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jchar"), + ReturnType = "jchar", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1320,7 +1320,7 @@ partial class Generator Name = "GetStaticShortField", Visibility = "internal", Prototype = "jshort (*GetStaticShortField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jshort"), + ReturnType = "jshort", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1328,7 +1328,7 @@ partial class Generator Name = "GetStaticIntField", Visibility = "internal", Prototype = "jint (*GetStaticIntField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1336,7 +1336,7 @@ partial class Generator Name = "GetStaticLongField", Visibility = "internal", Prototype = "jlong (*GetStaticLongField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1344,7 +1344,7 @@ partial class Generator Name = "GetStaticFloatField", Visibility = "internal", Prototype = "jfloat (*GetStaticFloatField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jfloat"), + ReturnType = "jfloat", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1352,7 +1352,7 @@ partial class Generator Name = "GetStaticDoubleField", Visibility = "internal", Prototype = "jdouble (*GetStaticDoubleField)(JNIEnv*, jclass, jfieldID);", - ReturnType = new TypeInfo ("jdouble"), + ReturnType = "jdouble", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID")}, }, new JniFunction { @@ -1361,7 +1361,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticObjectField)(JNIEnv*, jclass, jfieldID, jobject);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jobject", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1370,7 +1370,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticBooleanField)(JNIEnv*, jclass, jfieldID, jboolean);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jboolean", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1379,7 +1379,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticByteField)(JNIEnv*, jclass, jfieldID, jbyte);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jbyte", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1388,7 +1388,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticCharField)(JNIEnv*, jclass, jfieldID, jchar);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jchar", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1397,7 +1397,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticShortField)(JNIEnv*, jclass, jfieldID, jshort);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jshort", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1406,7 +1406,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticIntField)(JNIEnv*, jclass, jfieldID, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jint", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1415,7 +1415,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticLongField)(JNIEnv*, jclass, jfieldID, jlong);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jlong", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1424,7 +1424,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticFloatField)(JNIEnv*, jclass, jfieldID, jfloat);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jfloat", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1433,7 +1433,7 @@ partial class Generator ApiName = "SetStaticField", Visibility = "internal", Prototype = "void (*SetStaticDoubleField)(JNIEnv*, jclass, jfieldID, jdouble);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("jstaticfieldID", "jfieldID"), new ParamInfo ("jdouble", "val", Modifier.CanBeNull)}, }, new JniFunction { @@ -1443,15 +1443,15 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "jstring (*NewString)(JNIEnv*, const jchar*, jsize);", - ReturnType = new TypeInfo ("jstring"), - Parameters = new ParamInfo [] {new ParamInfo (new TypeInfo ("const jchar*", "IntPtr"), "unicodeChars"), new ParamInfo ("jsize", "len")}, + ReturnType = "jstring", + Parameters = new ParamInfo [] {new ParamInfo (TypeInfo.Create ("const jchar*", "IntPtr"), "unicodeChars"), new ParamInfo ("jsize", "len")}, }, new JniFunction { DeclaringType = "Strings", Name = "GetStringLength", Visibility = "internal", Prototype = "jsize (*GetStringLength)(JNIEnv*, jstring);", - ReturnType = new TypeInfo ("jsize"), + ReturnType = "jsize", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string")}, }, new JniFunction { @@ -1459,7 +1459,7 @@ partial class Generator Name = "GetStringChars", Visibility = "internal", Prototype = "const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*);", - ReturnType = new TypeInfo ("const jchar*", "IntPtr"), + ReturnType = TypeInfo.Create ("const jchar*", "IntPtr"), Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1467,8 +1467,8 @@ partial class Generator Name = "ReleaseStringChars", Visibility = "internal", Prototype = "void (*ReleaseStringChars)(JNIEnv*, jstring, const jchar*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo (new TypeInfo ("const jchar*", "IntPtr"), "chars")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo (TypeInfo.Create ("const jchar*", "IntPtr"), "chars")}, }, new JniFunction { DeclaringType = "Strings", @@ -1476,7 +1476,7 @@ partial class Generator Visibility = "private", Throws = true, Prototype = "jstring (*NewStringUTF)(JNIEnv*, const char*);", - ReturnType = new TypeInfo ("jstring"), + ReturnType = "jstring", Parameters = new ParamInfo [] {new ParamInfo ("const char*", "bytes")}, }, new JniFunction { @@ -1484,7 +1484,7 @@ partial class Generator Name = "GetStringUTFLength", Visibility = "private", Prototype = "jsize (*GetStringUTFLength)(JNIEnv*, jstring);", - ReturnType = new TypeInfo ("jsize"), + ReturnType = "jsize", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string")}, }, new JniFunction { @@ -1492,7 +1492,7 @@ partial class Generator Name = "GetStringUTFChars", Visibility = "private", Prototype = "const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*);", - ReturnType = new TypeInfo ("const char*"), + ReturnType = "const char*", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1500,7 +1500,7 @@ partial class Generator Name = "ReleaseStringUTFChars", Visibility = "private", Prototype = "void (*ReleaseStringUTFChars)(JNIEnv*, jstring, const char*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo ("const char*", "utf")}, }, new JniFunction { @@ -1509,7 +1509,7 @@ partial class Generator // CustomWrapper = true, Visibility = "public", Prototype = "jsize (*GetArrayLength)(JNIEnv*, jarray);", - ReturnType = new TypeInfo ("jsize"), + ReturnType = "jsize", Parameters = new ParamInfo [] {new ParamInfo ("jarray", "array_ptr")}, }, new JniFunction { @@ -1520,7 +1520,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobjectArray (*NewObjectArray)(JNIEnv*, jsize, jclass, jobject);", - ReturnType = new TypeInfo ("jobjectArray"), + ReturnType = "jobjectArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length"), new ParamInfo ("jclass", "elementClass"), new ParamInfo ("jobject", "initialElement", Modifier.CanBeNull)}, }, new JniFunction { @@ -1529,7 +1529,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobject (*GetObjectArrayElement)(JNIEnv*, jobjectArray, jsize);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("jobjectArray", "array"), new ParamInfo ("jsize", "index")}, }, new JniFunction { @@ -1538,7 +1538,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetObjectArrayElement)(JNIEnv*, jobjectArray, jsize, jobject);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jobjectArray", "array"), new ParamInfo ("jsize", "index"), new ParamInfo ("jobject", "value", Modifier.CanBeNull)}, }, new JniFunction { @@ -1546,7 +1546,7 @@ partial class Generator Name = "NewBooleanArray", Visibility = "public", Prototype = "jbooleanArray (*NewBooleanArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jbooleanArray"), + ReturnType = "jbooleanArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1554,7 +1554,7 @@ partial class Generator Name = "NewByteArray", Visibility = "public", Prototype = "jbyteArray (*NewByteArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jbyteArray"), + ReturnType = "jbyteArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1562,7 +1562,7 @@ partial class Generator Name = "NewCharArray", Visibility = "public", Prototype = "jcharArray (*NewCharArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jcharArray"), + ReturnType = "jcharArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1570,7 +1570,7 @@ partial class Generator Name = "NewShortArray", Visibility = "public", Prototype = "jshortArray (*NewShortArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jshortArray"), + ReturnType = "jshortArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1578,7 +1578,7 @@ partial class Generator Name = "NewIntArray", Visibility = "public", Prototype = "jintArray (*NewIntArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jintArray"), + ReturnType = "jintArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1586,7 +1586,7 @@ partial class Generator Name = "NewLongArray", Visibility = "public", Prototype = "jlongArray (*NewLongArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jlongArray"), + ReturnType = "jlongArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1594,7 +1594,7 @@ partial class Generator Name = "NewFloatArray", Visibility = "public", Prototype = "jfloatArray (*NewFloatArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jfloatArray"), + ReturnType = "jfloatArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1602,7 +1602,7 @@ partial class Generator Name = "NewDoubleArray", Visibility = "public", Prototype = "jdoubleArray (*NewDoubleArray)(JNIEnv*, jsize);", - ReturnType = new TypeInfo ("jdoubleArray"), + ReturnType = "jdoubleArray", Parameters = new ParamInfo [] {new ParamInfo ("jsize", "length")}, }, new JniFunction { @@ -1610,7 +1610,7 @@ partial class Generator Name = "GetBooleanArrayElements", Visibility = "public", Prototype = "jboolean* (*GetBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*);", - ReturnType = new TypeInfo ("jboolean*"), + ReturnType = "jboolean*", Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1618,7 +1618,7 @@ partial class Generator Name = "GetByteArrayElements", Visibility = "public", Prototype = "jbyte* (*GetByteArrayElements)(JNIEnv*, jbyteArray, jboolean*);", - ReturnType = new TypeInfo ("jbyte*"), + ReturnType = "jbyte*", Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1626,7 +1626,7 @@ partial class Generator Name = "GetCharArrayElements", Visibility = "public", Prototype = "jchar* (*GetCharArrayElements)(JNIEnv*, jcharArray, jboolean*);", - ReturnType = new TypeInfo ("jchar*"), + ReturnType = "jchar*", Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1634,7 +1634,7 @@ partial class Generator Name = "GetShortArrayElements", Visibility = "public", Prototype = "jshort* (*GetShortArrayElements)(JNIEnv*, jshortArray, jboolean*);", - ReturnType = new TypeInfo ("jshort*"), + ReturnType = "jshort*", Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1642,7 +1642,7 @@ partial class Generator Name = "GetIntArrayElements", Visibility = "public", Prototype = "jint* (*GetIntArrayElements)(JNIEnv*, jintArray, jboolean*);", - ReturnType = new TypeInfo ("jint*"), + ReturnType = "jint*", Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1650,7 +1650,7 @@ partial class Generator Name = "GetLongArrayElements", Visibility = "public", Prototype = "jlong* (*GetLongArrayElements)(JNIEnv*, jlongArray, jboolean*);", - ReturnType = new TypeInfo ("jlong*"), + ReturnType = "jlong*", Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1658,7 +1658,7 @@ partial class Generator Name = "GetFloatArrayElements", Visibility = "public", Prototype = "jfloat* (*GetFloatArrayElements)(JNIEnv*, jfloatArray, jboolean*);", - ReturnType = new TypeInfo ("jfloat*"), + ReturnType = "jfloat*", Parameters = new ParamInfo [] {new ParamInfo ("jfloatArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1666,7 +1666,7 @@ partial class Generator Name = "GetDoubleArrayElements", Visibility = "public", Prototype = "jdouble* (*GetDoubleArrayElements)(JNIEnv*, jdoubleArray, jboolean*);", - ReturnType = new TypeInfo ("jdouble*"), + ReturnType = "jdouble*", Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1674,7 +1674,7 @@ partial class Generator Name = "ReleaseBooleanArrayElements", Visibility = "public", Prototype = "void (*ReleaseBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jboolean*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1682,7 +1682,7 @@ partial class Generator Name = "ReleaseByteArrayElements", Visibility = "public", Prototype = "void (*ReleaseByteArrayElements)(JNIEnv*, jbyteArray, jbyte*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jbyte*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1690,7 +1690,7 @@ partial class Generator Name = "ReleaseCharArrayElements", Visibility = "public", Prototype = "void (*ReleaseCharArrayElements)(JNIEnv*, jcharArray, jchar*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jchar*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1698,7 +1698,7 @@ partial class Generator Name = "ReleaseShortArrayElements", Visibility = "public", Prototype = "void (*ReleaseShortArrayElements)(JNIEnv*, jshortArray, jshort*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jshort*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1706,7 +1706,7 @@ partial class Generator Name = "ReleaseIntArrayElements", Visibility = "public", Prototype = "void (*ReleaseIntArrayElements)(JNIEnv*, jintArray, jint*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jint*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1714,7 +1714,7 @@ partial class Generator Name = "ReleaseLongArrayElements", Visibility = "public", Prototype = "void (*ReleaseLongArrayElements)(JNIEnv*, jlongArray, jlong*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jlong*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1722,7 +1722,7 @@ partial class Generator Name = "ReleaseFloatArrayElements", Visibility = "public", Prototype = "void (*ReleaseFloatArrayElements)(JNIEnv*, jfloatArray, jfloat*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jfloatArray", "array"), new ParamInfo ("jfloat*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1730,7 +1730,7 @@ partial class Generator Name = "ReleaseDoubleArrayElements", Visibility = "public", Prototype = "void (*ReleaseDoubleArrayElements)(JNIEnv*, jdoubleArray, jdouble*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jdouble*", "elems"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1739,8 +1739,8 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*GetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, jboolean*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jboolean*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jboolean*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1748,8 +1748,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, jbyte*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jbyte*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jbyte*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1757,8 +1757,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, jchar*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jchar*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jchar*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1766,8 +1766,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, jshort*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jshort*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jshort*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1775,8 +1775,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, jint*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jint*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jint*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1784,8 +1784,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, jlong*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jlong*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jlong*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1793,8 +1793,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, jfloat*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jfloatArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jfloat*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jlong*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1802,8 +1802,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*GetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, jdouble*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("jdouble*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jdouble*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1811,8 +1811,8 @@ partial class Generator Visibility = "internal", Throws = true, Prototype = "void (*SetBooleanArrayRegion)(JNIEnv*, jbooleanArray, jsize, jsize, const jboolean*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jboolean*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jbooleanArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jboolean*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1820,8 +1820,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetByteArrayRegion)(JNIEnv*, jbyteArray, jsize, jsize, const jbyte*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jbyte*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jbyteArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jbyte*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1829,8 +1829,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetCharArrayRegion)(JNIEnv*, jcharArray, jsize, jsize, const jchar*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jchar*", "IntPtr"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jcharArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (TypeInfo.Create ("const jchar*", "IntPtr"), "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1838,8 +1838,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetShortArrayRegion)(JNIEnv*, jshortArray, jsize, jsize, const jshort*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jshort*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jshortArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jshort*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1847,8 +1847,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetIntArrayRegion)(JNIEnv*, jintArray, jsize, jsize, const jint*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jint*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jintArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jint*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1856,8 +1856,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetLongArrayRegion)(JNIEnv*, jlongArray, jsize, jsize, const jlong*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jlong*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jlongArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jlong*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1865,8 +1865,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetFloatArrayRegion)(JNIEnv*, jfloatArray, jsize, jsize, const jfloat*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jfloatArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jfloat*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jfloatArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jfloat*", "buf")}, }, new JniFunction { DeclaringType = "Arrays", @@ -1874,8 +1874,8 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "void (*SetDoubleArrayRegion)(JNIEnv*, jdoubleArray, jsize, jsize, const jdouble*);", - ReturnType = new TypeInfo ("void"), - Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo (new TypeInfo ("const jdouble*"), "buf")}, + ReturnType = "void", + Parameters = new ParamInfo [] {new ParamInfo ("jdoubleArray", "array"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("const jdouble*", "buf")}, }, new JniFunction { DeclaringType = "Types", @@ -1884,7 +1884,7 @@ partial class Generator // Prebind = true, Throws = true, Prototype = "jint (*RegisterNatives)(JNIEnv*, jclass, const JNINativeMethod*, jint);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass"), new ParamInfo ("const JNINativeMethod*", "methods"), new ParamInfo ("jint", "nMethods")}, }, new JniFunction { @@ -1892,7 +1892,7 @@ partial class Generator Name = "UnregisterNatives", Visibility = "internal", Prototype = "jint (*UnregisterNatives)(JNIEnv*, jclass);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jclass", "jclass")}, }, new JniFunction { @@ -1900,7 +1900,7 @@ partial class Generator Name = "MonitorEnter", Visibility = "public", Prototype = "jint (*MonitorEnter)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj")}, }, new JniFunction { @@ -1908,7 +1908,7 @@ partial class Generator Name = "MonitorExit", Visibility = "public", Prototype = "jint (*MonitorExit)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "obj")}, }, new JniFunction { @@ -1917,7 +1917,7 @@ partial class Generator Visibility = "public", // Prebind = true, Prototype = "jint (*GetJavaVM)(JNIEnv*, JavaVM**);", - ReturnType = new TypeInfo ("jint"), + ReturnType = "jint", Parameters = new ParamInfo [] {new ParamInfo ("JavaVM**", "vm")}, }, new JniFunction { @@ -1925,7 +1925,7 @@ partial class Generator Name = "GetStringRegion", Visibility = "private", Prototype = "void (*GetStringRegion)(JNIEnv*, jstring, jsize, jsize, jchar*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "str"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("jchar*", "buf")}, }, new JniFunction { @@ -1933,7 +1933,7 @@ partial class Generator Name = "GetStringUTFRegion", Visibility = "private", Prototype = "void (*GetStringUTFRegion)(JNIEnv*, jstring, jsize, jsize, char*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "str"), new ParamInfo ("jsize", "start"), new ParamInfo ("jsize", "len"), new ParamInfo ("char*", "buf")}, }, new JniFunction { @@ -1941,7 +1941,7 @@ partial class Generator Name = "GetPrimitiveArrayCritical", Visibility = "private", Prototype = "void* (*GetPrimitiveArrayCritical)(JNIEnv*, jarray, jboolean*);", - ReturnType = new TypeInfo ("void*"), + ReturnType = "void*", Parameters = new ParamInfo [] {new ParamInfo ("jarray", "array"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1949,7 +1949,7 @@ partial class Generator Name = "ReleasePrimitiveArrayCritical", Visibility = "private", Prototype = "void (*ReleasePrimitiveArrayCritical)(JNIEnv*, jarray, void*, jint);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jarray", "array"), new ParamInfo ("void*", "carray"), new ParamInfo ("jint", "mode")}, }, new JniFunction { @@ -1957,7 +1957,7 @@ partial class Generator Name = "GetStringCritical", Visibility = "private", Prototype = "const jchar* (*GetStringCritical)(JNIEnv*, jstring, jboolean*);", - ReturnType = new TypeInfo ("const jchar*"), + ReturnType = "const jchar*", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo ("jboolean*", "isCopy", Modifier.CanBeNull)}, }, new JniFunction { @@ -1965,7 +1965,7 @@ partial class Generator Name = "ReleaseStringCritical", Visibility = "private", Prototype = "void (*ReleaseStringCritical)(JNIEnv*, jstring, const jchar*);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("jstring", "@string"), new ParamInfo ("const jchar*", "carray")}, }, new JniFunction { @@ -1973,7 +1973,7 @@ partial class Generator Name = "NewWeakGlobalRef", Visibility = "internal", Prototype = "jweak (*NewWeakGlobalRef)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jweak"), + ReturnType = "jweak", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -1982,7 +1982,7 @@ partial class Generator ApiName = "DeleteWeakGlobalRef", Visibility = "internal", Prototype = "void (*DeleteWeakGlobalRef)(JNIEnv*, jweak);", - ReturnType = new TypeInfo ("void"), + ReturnType = "void", Parameters = new ParamInfo [] {new ParamInfo ("IntPtr", "jobject", Modifier.CanBeNull)}, }, new JniFunction { @@ -1990,7 +1990,7 @@ partial class Generator Name = "ExceptionCheck", Visibility = "internal", Prototype = "jboolean (*ExceptionCheck)(JNIEnv*);", - ReturnType = new TypeInfo ("jboolean"), + ReturnType = "jboolean", Parameters = new ParamInfo [] {}, }, new JniFunction { @@ -1999,7 +1999,7 @@ partial class Generator Visibility = "public", Throws = true, Prototype = "jobject (*NewDirectByteBuffer)(JNIEnv*, void*, jlong);", - ReturnType = new TypeInfo ("jobject"), + ReturnType = "jobject", Parameters = new ParamInfo [] {new ParamInfo ("void*", "address"), new ParamInfo ("jlong", "capacity")}, }, new JniFunction { @@ -2007,7 +2007,7 @@ partial class Generator Name = "GetDirectBufferAddress", Visibility = "public", Prototype = "void* (*GetDirectBufferAddress)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("void*"), + ReturnType = "void*", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "buf")}, }, new JniFunction { @@ -2015,7 +2015,7 @@ partial class Generator Name = "GetDirectBufferCapacity", Visibility = "public", Prototype = "jlong (*GetDirectBufferCapacity)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jlong"), + ReturnType = "jlong", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "buf")}, }, new JniFunction { @@ -2023,7 +2023,7 @@ partial class Generator Name = "GetObjectRefType", Visibility = "internal", Prototype = "jobjectRefType (*GetObjectRefType)(JNIEnv*, jobject);", - ReturnType = new TypeInfo ("jobjectRefType"), + ReturnType = "jobjectRefType", Parameters = new ParamInfo [] {new ParamInfo ("jobject", "jobject")}, }, };