Does the Storage module support reading/writing binary data?
(an alternative question could be: are strings in Bangle.js Unicode strings? or ASCII ones? if the latter, strings could be used instead of ArrayBuffers, making "binary" I/O just identical to "text" I/O)
Thanks in advance for your help!
Yes, if you have a standard storage file you can write binary data to it.
Easiest thing to do is give it a go, but I'm pretty sure you can just do require("Storage").write("MyFile", new Uint8Array([....]))
require("Storage").write("MyFile", new Uint8Array([....]))
When you read, I think you'll still get a String, but it's easy to convert with E.toArrayBuffer: http://www.espruino.com/Reference#l_E_toArrayBuffer
Ok, I will try it, thanks!
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