Это java-код
InputStream is = new FileInputStream("filename");
int numBytesToRead = 1024;
byte[] inBuffer = new byte[numBytesToRead];
int bytesRead = is.read(inBuffer, 0, numBytesToRead);
decodeAacBytes(inBuffer, bytesRead);
, а jni-код:
jint Java_com_example_test_MainActivity_decodeAacBytes(JNIEnv * env, jobject this, jbyteArray input, jint numBytes)
{
//copy bytes from java
jbyte* bufferPtr = (*env)->GetByteArrayElements(env, input, NULL);
char *inputBytes = malloc(numBytes * sizeof(char));
memcpy(inputBytes, bufferPtr, numBytes);
(*env)->ReleaseByteArrayElements(env, input, bufferPtr, 0);
return 0;
}
Значения теперь будут в массиве inputBytes