public static Stream?FromJniHandle(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) { return(null); } var inst = (IJavaObject?)Java.Lang.Object.PeekObject(handle); if (inst == null) { inst = (IJavaObject)Java.Interop.TypeManager.CreateInstance(handle, transfer); } else { JNIEnv.DeleteRef(handle, transfer); } return(new InputStreamInvoker((Java.IO.InputStream)inst)); }
internal static Stream FromNative(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) { return(null); } IJavaObject inst = Java.Lang.Object.PeekObject(handle); if (inst == null) { inst = Java.Interop.TypeManager.CreateInstance(handle, transfer); } else { JNIEnv.DeleteRef(handle, transfer); } return(new OutputStreamInvoker((Java.IO.OutputStream)inst)); }
public static IList FromJniHandle(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) { return(null); } IJavaObject inst = Java.Lang.Object.PeekObject(handle); if (inst == null) { inst = new JavaList(handle, transfer); } else { JNIEnv.DeleteRef(handle, transfer); } return((IList)inst); }
public static ICollection?FromJniHandle(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) { return(null); } var inst = (IJavaObject?)Java.Lang.Object.PeekObject(handle); if (inst == null) { inst = new JavaSet(handle, transfer); } else { JNIEnv.DeleteRef(handle, transfer); } return((ICollection)inst); }