You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #358 arrays will be returned as the respective TypedArray, but v8ToJava is lacking the functionality to convert them back. Therefore really slow (may take several seconds for a few megabytes) workarounds are needed:
var jArr = java.newArray("byte", Array.prototype.slice.call(int8array))
Here's what I came up with (quick and possibly dirty – I don't know anything about v8) for Int8Array:
if (arg->IsInt8Array())
{
v8::Local<v8::ArrayBuffer> ab = v8::Local<v8::TypedArray>::Cast(arg)->Buffer();
jbyteArray result = env->NewByteArray(ab->GetContents().ByteLength());
env->SetByteArrayRegion(result, 0, ab->GetContents().ByteLength(), (const jbyte *) ab->GetContents().Data());
return(result);
}