Class JsUtils
java.lang.Object
com.google.gwt.typedarrays.client.JsUtils
JS-specific utility methods, for use in client-side code that has the values in
JS objects already.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayBuffer
Creates anArrayBuffer
from a string, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values0x80-0xFF
take two bytes.static Float32ArrayNative
createFloat32Array
(JsArrayNumber array) static Float64ArrayNative
createFloat64Array
(JsArrayNumber array) static Int16ArrayNative
createInt16Array
(JsArrayInteger array) static Int32ArrayNative
createInt32Array
(JsArrayInteger array) static Int8ArrayNative
createInt8Array
(JsArrayInteger array) static Uint16ArrayNative
createUint16Array
(JsArrayInteger array) static Uint32ArrayNative
createUint32Array
(JsArrayNumber array) static Uint8ArrayNative
createUint8Array
(JsArrayInteger array) static Uint8ClampedArray
static void
set
(Float32Array dest, JsArrayNumber array) static void
set
(Float32Array dest, JsArrayNumber array, int offset) static void
set
(Float64Array dest, JsArrayNumber array) static void
set
(Float64Array dest, JsArrayNumber array, int offset) static void
set
(Int16Array dest, JsArrayInteger array) static void
set
(Int16Array dest, JsArrayInteger array, int offset) static void
set
(Int32Array dest, JsArrayInteger array) static void
set
(Int32Array dest, JsArrayInteger array, int offset) static void
set
(Int8Array dest, JsArrayInteger array) static void
set
(Int8Array dest, JsArrayInteger array, int offset) static void
set
(Uint16Array dest, JsArrayInteger array) static void
set
(Uint16Array dest, JsArrayInteger array, int offset) static void
set
(Uint32Array dest, JsArrayNumber array) static void
set
(Uint32Array dest, JsArrayNumber array, int offset) static void
set
(Uint8Array dest, JsArrayInteger array) static void
set
(Uint8Array dest, JsArrayInteger array, int offset) static void
set
(Uint8ClampedArray dest, JsArrayInteger array) static void
set
(Uint8ClampedArray dest, JsArrayInteger array, int offset) static String
Creates a string from anArrayBuffer
, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values0x80-0xFF
take two bytes.
-
Method Details
-
arrayBufferFromString
Creates anArrayBuffer
from a string, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values0x80-0xFF
take two bytes.- Parameters:
str
-- Returns:
- an
ArrayBuffer
containing the bytes decoded from the string
-
createFloat32Array
-
createFloat64Array
-
createInt16Array
-
createInt32Array
-
createInt8Array
-
createUint16Array
-
createUint32Array
-
createUint8Array
-
createUint8ClampedArray
-