List of usage examples for jdk.nashorn.internal.objects NativeArray push
@SpecializedFunction public static double push(final Object self, final Object arg)
From source file:org.siphon.common.js.JsTypeUtil.java
License:Open Source License
public ScriptObjectMirror bytesToNativeArray(byte[] arr) throws ScriptException { ScriptObjectMirror result = this.newArray(); NativeArray array = result.to(NativeArray.class); for (int i = 0; i < arr.length; i++) { NativeArray.push(array, arr[i]); // result.callMember("push", arr[i]); }//www .j a va 2s .co m return result; }