I would like to write an array fo Float32Array to sd and read it back later.
What is the best way to do this ?
It depends on the size of the array I guess, and whether you want it human readable or not.
array = new Float32Array(JSON.parse(fs.readFileSync("foo.txt")));
array = new Float32Array(E.toArrayBuffer(fs.readFileSync("foo.txt")));
For bigger arrays binary would be better, and for very big arrays you'd be looking at multiple save calls.
Wow, can't even write my questions as fast as your feedback is comin.
Thanks a lot.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem