iotjs
iotjs copied to clipboard
Update Buffer API
Compared with node.js, the buffer API of iot.js couldn't support many features. I would like to update it for latest node.js compatibility.
- [ ] Deprecated API : new Buffer(array/buffer/size/string)
- Add API
- [ ] create : Buffer.alloc, Buffer.from
- [x] array buffer : Buffer.from(arayBuffer)
- [ ] [] operator : buf[index]
- [ ] readDouble, writeDouble, readFlat, writeFloat
To add new features, we need support from JerryScript.
https://nodejs.org/dist/latest-v6.x/docs/api/buffer.html#buffer_buf_index
What about enabling ArrayBuffer would be a mandatory requirement for IoT.js? Then the Buffer could be rewritten to use ArrayBuffer as a base.