X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fresource-encapsulation%2Fandroid%2Fservice%2Fsrc%2Fmain%2Fjni%2Futil%2FJNIEnvWrapper.h;h=facc8074a90b0e60a3b0349181828a1403bb315b;hb=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20171010.063815;hp=2723178c24d657aadb9291b7e310c29f094c8409;hpb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/resource-encapsulation/android/service/src/main/jni/util/JNIEnvWrapper.h b/service/resource-encapsulation/android/service/src/main/jni/util/JNIEnvWrapper.h index 2723178..facc807 100644 --- a/service/resource-encapsulation/android/service/src/main/jni/util/JNIEnvWrapper.h +++ b/service/resource-encapsulation/android/service/src/main/jni/util/JNIEnvWrapper.h @@ -294,7 +294,14 @@ public: return ret; } - jobjectArray NewObjectArray(jsize len, jclass cls, jobject init) + jbyteArray NewByteArray(jsize len) + { + auto ret = m_env->NewByteArray(len); + if (m_env->ExceptionCheck()) throw JavaException(); + return ret; + } + + jobjectArray NewObjectArray(jsize len, jclass cls, jobject init) { auto ret = m_env->NewObjectArray(len, cls, init); if (m_env->ExceptionCheck()) throw JavaException(); @@ -315,6 +322,13 @@ public: return ret; } + jbyte *GetByteArrayElements(jbyteArray array, jboolean *value) + { + auto ret = m_env->GetByteArrayElements(array, value); + if (m_env->ExceptionCheck()) throw JavaException(); + return ret; + } + void SetObjectArrayElement(jobjectArray array, jsize index, jobject val) { m_env->SetObjectArrayElement(array, index, val); @@ -339,6 +353,12 @@ public: if (m_env->ExceptionCheck()) throw JavaException(); } + void SetByteArrayRegion(jbyteArray array, jsize start, jsize len, const jbyte *buf) + { + m_env->SetByteArrayRegion(array, start, len, buf); + if (m_env->ExceptionCheck()) throw JavaException(); + } + void* GetPrimitiveArrayCritical(jarray array, jboolean* isCopy) { auto ret = m_env->GetPrimitiveArrayCritical(array, isCopy); @@ -352,7 +372,14 @@ public: if (m_env->ExceptionCheck()) throw JavaException(); } - void ThrowNew(jclass cls, const char* msg) { + void ReleaseByteArrayElements(jbyteArray array, jbyte* byteArray, int mode) + { + m_env->ReleaseByteArrayElements(array, byteArray, mode); + if (m_env->ExceptionCheck()) throw JavaException(); + } + + void ThrowNew(jclass cls, const char* msg) + { m_env->ThrowNew(cls, msg); throw JavaException(); }