array length differs on java side and the native side
843829Feb 3 2004 — edited Feb 4 2004Hi,
I am passing a hashed byte array to a native code in "C". When i check the length of the byte array in the java side using bArray.length,i get a value of 16.
In the native code i get a value of 17!!! How can this be possible.
My native code is as follows.
BYTE *pbBuffer;
JNIEXPORT void JNICALL Java_Testapp_certificateKey
(JNIEnv * jEnv, jobject obj, jstring jcert,jbyteArray testByteArray){
jsize byteArraySize=(*jEnv)->GetArrayLength(jEnv,testByteArray);
jbyte * pMin=(jbyte *)(*jEnv)->GetByteArrayElements(jEnv,testByteArray,0);
pbBuffer= (BYTE*)malloc(byteArraySize);
pbBuffer=(BYTE *)pMin;
dwBufferLen=strlen((BYTE *)pbBuffer);
wsprintf(msg,"Signature length %d found.\n",dwBufferLen);