iotjs icon indicating copy to clipboard operation
iotjs copied to clipboard

Update Buffer API

Open hs0225 opened this issue 8 years ago • 1 comments

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

hs0225 avatar Feb 16 '17 03:02 hs0225

What about enabling ArrayBuffer would be a mandatory requirement for IoT.js? Then the Buffer could be rewritten to use ArrayBuffer as a base.

zherczeg avatar Oct 25 '18 08:10 zherczeg