com.google.gwt.typedarrays.client

## Class JsUtils

- java.lang.Object
- - com.google.gwt.typedarrays.client.JsUtils

-     public class JsUtils
      extends java.lang.Object

  JS-specific utility methods, for use in client-side code that has the values in JS objects already.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ArrayBuffer` | `arrayBufferFromString(java.lang.String str)` Creates an `ArrayBuffer` from a string, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values `0x80-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` | `createUint8ClampedArray(JsArrayInteger array)`
    `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 java.lang.String` | `stringFromArrayBuffer(ArrayBuffer buf)` Creates a string from an `ArrayBuffer`, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values `0x80-0xFF` take two bytes.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### arrayBufferFromString

          public static ArrayBuffer arrayBufferFromString(java.lang.String str)

      Creates an `ArrayBuffer` from a string, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values `0x80-0xFF` take two bytes.
      Parameters:
        `str` -
      Returns:
        an `ArrayBuffer` containing the bytes decoded from the string

    - #### createFloat32Array

          public static Float32ArrayNative createFloat32Array(JsArrayNumber array)

    - #### createFloat64Array

          public static Float64ArrayNative createFloat64Array(JsArrayNumber array)

    - #### createInt16Array

          public static Int16ArrayNative createInt16Array(JsArrayInteger array)

    - #### createInt32Array

          public static Int32ArrayNative createInt32Array(JsArrayInteger array)

    - #### createInt8Array

          public static Int8ArrayNative createInt8Array(JsArrayInteger array)

    - #### createUint16Array

          public static Uint16ArrayNative createUint16Array(JsArrayInteger array)

    - #### createUint32Array

          public static Uint32ArrayNative createUint32Array(JsArrayNumber array)

    - #### createUint8Array

          public static Uint8ArrayNative createUint8Array(JsArrayInteger array)

    - #### createUint8ClampedArray

          public static Uint8ClampedArray createUint8ClampedArray(JsArrayInteger array)

    - #### set

          public static void set(Float32Array dest,
                                 JsArrayNumber array)

    - #### set

          public static void set(Float32Array dest,
                                 JsArrayNumber array,
                                 int offset)

    - #### set

          public static void set(Float64Array dest,
                                 JsArrayNumber array)

    - #### set

          public static void set(Float64Array dest,
                                 JsArrayNumber array,
                                 int offset)

    - #### set

          public static void set(Int16Array dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Int16Array dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### set

          public static void set(Int32Array dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Int32Array dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### set

          public static void set(Int8Array dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Int8Array dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### set

          public static void set(Uint16Array dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Uint16Array dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### set

          public static void set(Uint32Array dest,
                                 JsArrayNumber array)

    - #### set

          public static void set(Uint32Array dest,
                                 JsArrayNumber array,
                                 int offset)

    - #### set

          public static void set(Uint8Array dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Uint8Array dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### set

          public static void set(Uint8ClampedArray dest,
                                 JsArrayInteger array)

    - #### set

          public static void set(Uint8ClampedArray dest,
                                 JsArrayInteger array,
                                 int offset)

    - #### stringFromArrayBuffer

          public static java.lang.String stringFromArrayBuffer(ArrayBuffer buf)

      Creates a string from an `ArrayBuffer`, with bytes encoded as individual characters (which means in UTF8-encoded strings, byte values `0x80-0xFF` take two bytes.
      Parameters:
        `buf` -
      Returns:
        a string encoding the bytes in the `ArrayBuffer`