serial-data-view
Serial, Heterogeneous access to an ArrayBuffer
AssemblyScript library to work with binary data
Supports;
- Heterogeneous reading of data
- Heterogeneous writing of data
- Serial access, current byte position is incremented after each operation
- Setting Endianness
Usage
; ;view.readFloat32; // 12.0view.readUint8; // 0x40view.readUint8; // 0x80view.position; // 6
; ; // littleEndianview.writeFloat32120view.writeInt3212345;view.position; // 8view.toString; // "00 00 40 41 39 30 00 00 00 00"
From JS
; const buffer = Buffer;const view = buffer; view; // 72view; // 101viewposition; // 2
Install
npm install serial-data-view --save-dev