Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to type cast the byte array to void * (pointer)

843829Oct 10 2007 — edited Oct 10 2007
Here is the Code that i am using in the JNI fucntion from that function i have to call the c function which in the Same file .
below is the code
    JNIEXPORT jbyteArray JNICALL Java_IntArray_sumArray
  (JNIEnv *env, jobject obj, jbyteArray arr, jbyteArray arr1)
{
jint i;
int len = (*env)->GetArrayLength(env,arr);
int length =(*env)->GetArrayLength(env,arr1);
printf("length=%d \n",len);
printf("Length of second array = %d\n",length);
jbyte *carr = (jbyte *)(*env)->GetByteArrayElements(env,arr,NULL);
jbyte *carr1 = (jbyte *)(*env)->GetByteArrayElements(env,arr1,NULL);
jbyteArray jdest =(*env)->NewByteArray(env,len);


if(jdest != NULL){
 (*env)->SetByteArrayRegion(env,jdest,0,len,(jbyte *)carr);
   return(jdest);
}

 piximcontroller(jdest,arr);   /* How to type cast it to void * */
the c function declaration is
void piximController(void *pInputArg,void *pOutputArg) 
Please help me in this issue how to call that function from JNI fucntion
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 7 2007
Added on Oct 10 2007
1 comment
571 views