How to transfer void * data from CPP to java by NDK

the project I am working on needs to read the camera data from C # and pass it to java for processing.

I don"t know how to implement it, but I can"t find a lot of examples on the Internet

my current implementation is as follows. I don"t know where there is a problem. Do you have any familiar classmates?

extern "C"
jbyteArray JNICALL Java_com_example_administrator_mmap_MainActivity_getFrame(
        JNIEnv *env,
        jobject) {

    void *buff = NULL;
    int ret ;

    jbyteArray array = NULL;


    ret = pFrameClient->readFrame(&buff);

    if(ret == 0)
    {
        ALOGD("debug, wait");
    }
    else{
        array = env->NewByteArray(ret);
        env->SetByteArrayRegion(array, 0, ret, (jbyte *)buff);
        ALOGD("debug, read frame %d", ret);
    }


    return array;
}

Mar.28,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eae706-47f9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eae706-47f9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?