title: What is the most efficient way to pass a large set of strings from Java to c++ through JNI
body: <p>I'm trying to write a JNI wrapper for HBase HFiles, so that I can read all the key value pairs  from an HFile in my c++ code in one JNI call. I could potentially just get an array of jstring for each key valye pair but I'm not sure if that's  the most efficient way of doing it. I'm wondering if there is a way for me to write all the strings in a ByteBuffer, pass it to the c++ side where I can recover all the strings correctly? One way that I can think of is create my own proto buffer with repeated strings but seems like there's got to be a better solution out there.</p>