Javascript Uint32Array Type

Introduction

A Uint32Array object describes an array-like view of an underlying binary data buffer.

The constructors are listed as follows:

new Uint32Array();
new Uint32Array(length);
new Uint32Array(typedArray);
new Uint32Array(object);
new Uint32Array(buffer [, byteOffset [, length]]);
Parameter Optional Meaning
length Requiredan internal array buffer is created of size length multiplied by BYTES_PER_ELEMENT bytes.
typedArrayRequiredthe typedArray is copied into a new typed array.
object Requireduse the Uint32Array.from() method.
buffer Required create from buffer
byteOffset optional offset to start
length optionallength to copy

Property access

You can reference elements in the array using standard array index syntax.

var int16 = new Uint32Array(2);
int16[0] = 42;//from   w w w  .  j  a va 2  s . c  om
console.log(int16[0]); // 42
Type Value Range Size in bytes DescriptionEquivalent C type
Uint32Array 0 to 4294967295 4 32-bit unsigned integeruint32_t



PreviousNext

Related