title: JNI:Using Wrapper Types for primitive data types to simulate passing by pointers in C++
body: <p>The problem is the famous parameter passing problem in JNI.</p>
  
  <p>I want to wrap a c++ code that passes primitive parameters by pointer
  and
  I just want to confirm one thing, to make sure that the Wrapper classes can not be use for my problem.</p>
  
  <p>As you all know the Wrapper types like Byte(for byte) and Interger(for int) do not support setter method so i can't use them to set the value of a passes object using the setter,</p>
  
  <p>But, what about the assignment operator?</p>
  
  <p>Is there any way i can call the assignment operator(=) of Wrapper Type "Byte" using JNI in the C++ code?</p>
  
  <p>a codeed sample of the idea is as follows:</p>
  
  <pre><code>JNIEXPORT void JNICALL 
  Java_InstanceMethodCall_nativeMethod(JNIEnv *env, jobject obj/*A Byte object*/)
  {
      jclass cls = (*env)-&gt;GetObjectClass(env, obj);
      jmethodID mid = (*env)-&gt;GetMethodID(env, cls, "=(or something else you can tell me)", "(B)V");
      if (mid == NULL) {
          return; /* method not found */
      }
      (*env)-&gt;CallVoidMethod(env, obj, mid);
  }
  </code></pre>