示例#1
0
        public unsafe WebSocketReceiver(global::System.IO.Stream input, global::Java.IO.PipedInputStream pipedInputStream)
            : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
        {
            if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
            {
                return;
            }

            IntPtr native_input = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle(input);

            try {
                JValue *__args = stackalloc JValue [2];
                __args [0] = new JValue(native_input);
                __args [1] = new JValue(pipedInputStream);
                if (((object)this).GetType() != typeof(WebSocketReceiver))
                {
                    SetHandle(
                        global::Android.Runtime.JNIEnv.StartCreateInstance(((object)this).GetType(), "(Ljava/io/InputStream;Ljava/io/PipedInputStream;)V", __args),
                        JniHandleOwnership.TransferLocalRef);
                    global::Android.Runtime.JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, "(Ljava/io/InputStream;Ljava/io/PipedInputStream;)V", __args);
                    return;
                }

                if (id_ctor_Ljava_io_InputStream_Ljava_io_PipedInputStream_ == IntPtr.Zero)
                {
                    id_ctor_Ljava_io_InputStream_Ljava_io_PipedInputStream_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Ljava/io/InputStream;Ljava/io/PipedInputStream;)V");
                }
                SetHandle(
                    global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Ljava_io_InputStream_Ljava_io_PipedInputStream_, __args),
                    JniHandleOwnership.TransferLocalRef);
                JNIEnv.FinishCreateInstance(((global::Java.Lang.Object) this).Handle, class_ref, id_ctor_Ljava_io_InputStream_Ljava_io_PipedInputStream_, __args);
            } finally {
                JNIEnv.DeleteLocalRef(native_input);
            }
        }
示例#2
0
        public unsafe WebSocketReceiver(global::System.IO.Stream input, global::Java.IO.PipedInputStream pipedInputStream)
            : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
        {
            const string __id = "(Ljava/io/InputStream;Ljava/io/PipedInputStream;)V";

            if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
            {
                return;
            }

            IntPtr native_input = global::Android.Runtime.InputStreamAdapter.ToLocalJniHandle(input);

            try {
                JniArgumentValue *__args = stackalloc JniArgumentValue [2];
                __args [0] = new JniArgumentValue(native_input);
                __args [1] = new JniArgumentValue((pipedInputStream == null) ? IntPtr.Zero : ((global::Java.Lang.Object)pipedInputStream).Handle);
                var __r = _members.InstanceMethods.StartCreateInstance(__id, ((object)this).GetType(), __args);
                SetHandle(__r.Handle, JniHandleOwnership.TransferLocalRef);
                _members.InstanceMethods.FinishCreateInstance(__id, this, __args);
            } finally {
                JNIEnv.DeleteLocalRef(native_input);
            }
        }