This is an near-full es6 compatible implementation of the TypedArrays specification for binary data views. Differences listed below.
- low level (use target specific optimization)
- lightweight (use abstracts where possible etc)
- spec compatible
- haxe 3.1.3 compatible
- supports all targets
###targets:
Compatible targets, passing all tests (on 3.2 current):
- js
- neko
- cpp
Targets compiling, but not passing: Failing tests are related to negative int values, will be addressed.
- php (13/72 fail)
- python (4/72 fail)
- java (5/72 fail)
- swf (4/72 fail)
Targets not compiling:
- csharp (@.value errors, will investigate)
###todo:
- Lower footprint where possible (BytesData wrapping atm)
- Endianness handling is not fully yet
- structure is set up for it, some are done, but ArrayBufferIO should implement all cases
- unit tests for endianness correctness and usage
- defaults to little endian or underlying platform/haxe code
- add unit tests for DataView examples
- use haxe.unit for agnostic tests instead of moxha
- throughput performance tests for regression
- All IO operations go through the ArrayBufferIO path only, this allows for platform specific+endian changing code to be easy to maintain, and not scattered across the rest.
- on JS targets where types are native, those are used instead
- where possible (c++/neko) fast/direct memory access is used
- ArrayBuffer
- data store, haxe.io.Bytes abstract
- ArrayBufferView
- lightweight class, handles all underlying types
- DataView
- Int8Array
- Int16Array
- Int32Array
- UInt8Array
- UInt8ClampedArray
- UInt16Array
- UInt32Array
- Float32Array
- Float64Array
###Differences with spec
- (will implement in future) Spec allows Type1.set(Type2) and new Type1(Type2), with conversion between bytes
- spec for allowance, if A != B type, section 22.2.1.2 #17
- should use FPHelper in future
- spec for conversion, get/set
Thanks to the following contributors for their input over time:
- Hugh Sanderson (Original ByteArray, nme code)
- Thomas Hourdel (Original Unit test code from spec)
- Michael Bickel (Code contributions and sparring)
- Joshua Granick (Work on lime versions)
- Nicolas Cannasse (Advice and feedback)
MIT Licensed See LICENSE.md