MCPcopy Create free account
hub / github.com/Snapchat/Valdi / newJavaByteArray

Function newJavaByteArray

valdi_core/src/valdi_core/jni/JavaUtils.cpp:405–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405djinni::LocalRef<jobject> newJavaIntObject(int32_t value) {
406 auto& cache = JavaCache::get();
407 return cache.getIntegerClass().newObject(cache.getIntegerConstructorMethod(), value);
408}
409
410djinni::LocalRef<jobject> newJavaLongObject(int64_t value) {
411 auto& cache = JavaCache::get();
412 return cache.getLongClass().newObject(cache.getLongConstructorMethod(), value);
413}
414
415djinni::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

Callers 3

toJavaObjectFunction · 0.85
getModuleEntryMethod · 0.85
newByteArrayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected