Fix DataStoreGetFunction.

This commit is contained in:
Grant Limberg 2015-05-28 20:37:16 -07:00
parent 58ca657da6
commit b6196a53de

View File

@ -333,10 +333,13 @@ namespace {
if(retval > 0) if(retval > 0)
{ {
env->GetByteArrayRegion(bufferObj, 0, retval, (jbyte*)buffer); jbyte *data = env->GetByteArrayElements(bufferObj, NULL);
env->GetLongArrayRegion(objectSizeObj, 0, 1, (jlong*)out_objectSize); memcpy(buffer, data, retval);
env->DeleteLocalRef(bufferObj); env->ReleaseByteArrayElements(bufferObj, data, JNI_ABORT);
env->DeleteLocalRef(objectSizeObj);
jlong *objSize = env->GetLongArrayElements(objectSizeObj, NULL);
*out_objectSize = (unsigned long)objSize[0];
env->ReleaseLongArrayElements(objectSizeObj, objSize, JNI_ABORT);
} }
LOGI("Out Object Size: %lu", *out_objectSize); LOGI("Out Object Size: %lu", *out_objectSize);