title: JNI / C library: passing byte ptr
body: <p>I have an <code>unsigned char*</code> in my C library, and I am calling a JNI-exported function that needs to set a java object with this data, preferably in a <code>byte[]</code>.</p>
  
  <p>But this function will be called very often, and it's quite a lot of data to be copied. </p>
  
  <p>Is it possible to use a ByteBuffer and assign the pointer of that ByteBuffer to my <code>unsigned char*</code>? Or does it only work the other way round?</p>
  
  <p>Can I even do this without copying the data? What would be the best way to access it?</p>
  
  <p>The size of the data in the <code>unsigned char*</code> is known.</p>