In case I'm just stupid, I'd be glad to her that. :)
Here is my code:
var t16 = new Uint16Array( new Uint8Array([1, 2, 3, 4]));
console.log(t16.BYTES_PER_ELEMENT);
for( var i = 0; i < t16.length; i++)
console.log(t16[i]);
And here is the output I got:
[02:56:32.197] 2
[02:56:32.197] 1
[02:56:32.197] 2
[02:56:32.197] 3
[02:56:32.197] 4
From the documentation I would expect:
2
513
1027
In the real project I'm using a tar library that delivers an ArrayBuffer containing 16-Bit data that I'd like to read, but I always get only access to the 8-Bit values.
Are my expectations wrong? At least that's how I read section "Working with complex data structures" in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
For the records: Firefox is 23.0.1, Java is Platform SE 7 U25 10.25.2.17 and Firefox OS simulator is 5.0pre3 on a W7/64 machine.