We can now pass a typedarray over to the platform w/o recreating the data these are passed as directBuffers ..... so 🤷🏽♂️
.eg
const myData = new Float32Array(4);
console.log(Array.from(myData)); /// quick way to the values; prints [0,0,0,0]
io.github.triniwiz.buffer.Buffer.update(myData);
console.log(Array.from(myData)); /// quick way to the values; prints [1,2,3,4];
package io.github.triniwiz.buffer;
import java.nio.FloatBuffer;
public class Buffer {
public static void update(FloatBuffer buffer){
buffer.put(new float[]{1,2,3,4});
}
}
We can now pass a typedarray over to the platform w/o recreating the data these are passed as directBuffers ..... so 🤷🏽♂️
.eg