JNI - Passing large amounts of data between Java and Native code

后端 未结 2 1359
眼角桃花
眼角桃花 2021-01-30 07:09

I am trying to achieve the following:

1) I have a byte array on the java side that represents an image.

2) I need to give my native code access to it.

3

2条回答
  •  轮回少年
    2021-01-30 07:44

    1. Byte array

    2. I had to something similar, I returned a container (Vector or something) of Byte arrays. One of the other programmers implemented this as (and I think this is easier but a bit silly) a call-back. e.g. the JNI code would call a Java method for each response, then the original call (into the JNI code) would return. This does work okay though.

提交回复
热议问题