| 718 | } |
| 719 | |
| 720 | MMKV_JNI jbyteArray decodeBytes(JNIEnv *env, jobject obj, jlong handle, jstring oKey) { |
| 721 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
| 722 | if (kv && oKey) { |
| 723 | string key = jstring2string(env, oKey); |
| 724 | mmkv::MMBuffer value; |
| 725 | auto hasValue = kv->getBytes(key, value); |
| 726 | if (hasValue) { |
| 727 | jbyteArray result = env->NewByteArray(value.length()); |
| 728 | env->SetByteArrayRegion(result, 0, value.length(), (const jbyte *) value.getPtr()); |
| 729 | return result; |
| 730 | } |
| 731 | } |
| 732 | return nullptr; |
| 733 | } |
| 734 | |
| 735 | MMKV_JNI jobjectArray allKeys(JNIEnv *env, jobject instance, jlong handle, jboolean filterExpire) { |
| 736 | MMKV *kv = reinterpret_cast<MMKV *>(handle); |
nothing calls this directly
no test coverage detected