A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Uint32Array below:

Uint32Array ยท WebPlatform Docs

Uint32Array Summary

A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.

Syntax
uint32Array = new Uint32Array( length );

uint32Array = new Uint32Array( array );

uint32Array = new Uint32Array( buffer , byteOffset , length );
uint32Array
Required. The variable name to which the Uint32Array object is assigned.
length
Specifies the length (in bytes) of the array.
array
The array (or typed array) that is contained in this array. The contents are initialized to the contents of the given array or typed array, with each element converted to the Uint32 type.
buffer
The ArrayBuffer that the Uint32Array represents.
byteOffset
Optional. Specifies the offset in bytes from the start of the buffer at which the Uint32Array should begin.
length
The length of the array.
Examples

The following example shows how to use a Uint32Array object to process the binary data acquired from an XMLHttpRequest:

var req = new XMLHttpRequest();
     req.open('GET', "http://www.example.com");
     req.responseType = "arraybuffer";
     req.send();

     req.onreadystatechange = function () {
         if (req.readyState === 4) {
             var buffer = req.response;
             var dataview = new DataView(buffer);
             var ints = new Uint32Array(buffer.byteLength / 4);
             for (var i = 0; i < ints.length; i++) {
                 ints[i] = dataview.getUint32(i * 4);
             }
         alert(ints[10]);
         }
     }
Constants

The following table lists the constants of the Uint32Array object.

Properties

The following table lists the constants of the Uint32Array object.

Property Description buffer Property Read-only. Gets the ArrayBuffer that is referenced by this array. byteLength Property Read-only. The length of this array from the start of its ArrayBuffer, in bytes, as fixed at construction time. byteOffset Property Read-only. The offset of this array from the start of its ArrayBuffer, in bytes, as fixed at construction time. length Property The length of the array. Methods

The following table lists the methods of the Uint32Array object.

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4