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

Function toByteArray

valdi_core/src/valdi_core/jni/JavaUtils.cpp:489–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487void destroyInternedString(jlong ptr) {
488 Valdi::unsafeBridgeRelease(reinterpret_cast<void*>(ptr));
489}
490
491Valdi::StringBox unwrapInternedString(jlong ptr) {
492 if (ptr == 0) {
493 return Valdi::StringBox();
494 }
495
496 return Valdi::StringBox(Valdi::unsafeBridge<Valdi::InternedStringImpl>(reinterpret_cast<void*>(ptr)));
497}
498
499Valdi::BytesView toByteArray(JavaEnv /*env*/, jbyteArray array) {
500 auto jLength = JavaEnv::accessEnvRet([&](JNIEnv& env) -> jint { return env.GetArrayLength(array); });
501
502 auto bytes = Valdi::makeShared<Valdi::Bytes>();
503 bytes->resize(static_cast<size_t>(jLength));

Callers 8

valueFromJavaByteArrayFunction · 0.70
toCppMethod · 0.50
loadModuleContentMethod · 0.50
updateResourceMethod · 0.50
getSecretKeyMethod · 0.50
valueToByteArrayMethod · 0.50
nativeParseMethod · 0.50

Calls 3

BytesViewClass · 0.50
resizeMethod · 0.45
dataMethod · 0.45

Tested by 1

toCppMethod · 0.40