예제 #1
0
        public bool TryCatchEcxeption(out LocalRef ex)
        {
            if (GetDelegate <ExceptionCheck>(functions.ExceptionCheckPtr)(envPtr))
            {
                ex = new LocalRef(GetDelegate <ExceptionOccurred>(functions.ExceptionOccurredPtr)(envPtr));
                return(true);
            }

            ex = null;
            return(false);
        }
예제 #2
0
        public LocalRef[] GetArray(IntPtr arrayPtr)
        {
            var length = SafeJniCall(GetDelegate <GetArrayLength>(functions.GetArrayLengthPtr).Invoke,
                                     arrayPtr);
            var ret = new LocalRef[length];

            for (var i = 0; i < length; i++)
            {
                ret[i] =
                    new LocalRef(
                        SafeJniCall(GetDelegate <GetObjectArrayElement>(functions.GetObjectArrayElementPtr).Invoke,
                                    arrayPtr, i));
            }
            return(ret);
        }