JavaScript Typed Array use native endian
The following buffer is created:
12 | 34 |
a[0] | a[1] |
b[0] |
Uint16Array, Uint32Array, Int16Array, and Int32Array (JavaScript Typed Array) seem to use native endian.
If you use little endian machine (e.g. x86, x64), b[0]
is 0x3412
.
If you use big endian machine (e.g. Sun SPARC, PowerPC), b[0]
is 0x1234
. (But I did not check since I have no big endian machine.)
See also
- Typed Array Specification
- Re: Adoption of the Typed Array Specification (public-script-coord at w3.org)