title: Copying a byte buffer with JNI
body: <p>I've found plenty of tutorials / questions on Stackoverflow that deal with copying char arrays from C/JNI side into something like a byte[] in Java, but not the other way around. </p>
  
  <p>I am using a native C library which expects a byte array. I simply want to get data from a byte[] in java, into preferably an unsigned char[] in C.</p>
  
  <p>Long story short: What is the best way of copying data from a jBytearray in JNI? Is there any way to detect it's size?</p>