title: JNI - jByteArray to cli::array
body: <p>I am working with JNI for the first time, and am trying to pass a byte array from a Java applet to a C# DLL through a C++ JNI assembly. </p>
  
  <p>The JNI signature...</p>
  
  <pre><code>JNIEXPORT void JNICALL Java_MyApplet_invokeManager(JNIEnv *jniEnvPtr, jobject javaObj, jbyteArray encodedData)
  </code></pre>
  
  <p>The call to the C# DLL...</p>
  
  <pre><code>myManager-&gt;ShowQueue(encodedData);
  </code></pre>
  
  <p>The error message...</p>
  
  <pre><code>error C2664: 'MyModule::JNIToManaged::ShowQueue' : cannot convert parameter 2 from 'jbyteArray' to 'cli::array&lt;Type,dimension&gt; ^'   C:\Development\CrystalClient\CrystalPrintJNI\CrystalPrintJNI\CrystalPrintJNI.cpp
  </code></pre>
  
  <p>Do I need to loop through the jByteArray and store the bytes into a new array? Can someone provide some guidance please? Thanks!</p>