JNI jbyteArray转char*
char* ConvertJByteaArrayToChars(JNIEnv *env, jbyteArray bytearray)
{
char *chars = NULL;
jbyte *bytes;
bytes = env->GetByteArrayElements(bytearray, 0);
int chars_len = env->GetArrayLength(bytearray);
chars = new char[chars_len + 1];
memset(chars,0,chars_len + 1);
memcpy(chars, bytes, chars_len);
chars[chars_len] = 0;
env->ReleaseByteArrayElements(bytearray, bytes, 0);
return chars;
}