Class: shaka.util.StringUtils

A set of string utility functions.

Source:

Methods

(static) fromBytesAutoDetect(datanullable) → {string}

Creates a string from the given buffer, auto-detecting the encoding that is being used. If it cannot detect the encoding, it will throw an exception.
Parameters:
Name Type Attributes Description
data BufferSource <nullable>
Source:
Throws:
Returns:
Type
string

(private, static) fromCharCode_(argsnon-null) → {string}

Creates a new string from the given array of char codes.
Parameters:
Name Type Description
args ITypedArray
Source:
Returns:
Type
string

(static) fromUTF8(datanullable) → {string}

Creates a string from the given buffer as UTF-8 encoding.
Parameters:
Name Type Attributes Description
data BufferSource <nullable>
Source:
Throws:
Returns:
Type
string

(static) fromUTF16(datanullable, littleEndian) → {string}

Creates a string from the given buffer as UTF-16 encoding.
Parameters:
Name Type Attributes Description
data BufferSource <nullable>
littleEndian boolean true to read little endian, false to read big.
Source:
Throws:
Returns:
Type
string

(static) toUTF8(str) → (non-null) {ArrayBuffer}

Creates a ArrayBuffer from the given string, converting to UTF-8 encoding.
Parameters:
Name Type Description
str string
Source:
Returns:
Type
ArrayBuffer