| 403 | } |
| 404 | |
| 405 | djinni::LocalRef<jobject> newJavaIntObject(int32_t value) { |
| 406 | auto& cache = JavaCache::get(); |
| 407 | return cache.getIntegerClass().newObject(cache.getIntegerConstructorMethod(), value); |
| 408 | } |
| 409 | |
| 410 | djinni::LocalRef<jobject> newJavaLongObject(int64_t value) { |
| 411 | auto& cache = JavaCache::get(); |
| 412 | return cache.getLongClass().newObject(cache.getLongConstructorMethod(), value); |
| 413 | } |
| 414 | |
| 415 | djinni::LocalRef<jbyteArray> newJavaByteArray(const Valdi::Byte* data, size_t length) { |
| 416 | const auto bufferSize = static_cast<jsize>(length); |
| 417 | |
| 418 | return JavaEnv::accessEnvRetRef([&](JNIEnv& env) -> jbyteArray { |
| 419 | auto* byteArray = env.NewByteArray(bufferSize); |
| 420 |
no outgoing calls
no test coverage detected