Binary, ByteArray and ByteString classes as defined in CommonJS Binary/B. This file is included in ink-strings primarily to support the base64 encoding methods in module:ink/strings/base64. But they are still a valuable set of tools if you need 'em.
- Copyright:
- Copyright 2012 Hannes Wallnoefer
- Copyright 2012 Hannes Wallnoefer
- Source:
Classes
Members
-
<inner> encodings
-
The valid set of encoding supported by this library
- Source:
Properties:
Name Type Description US-ASCII
string 'ascii'
UTF-8
string 'utf8'
ISO-10646-UCS-2
string 'ucs2'
Methods
-
<static> toByteArray(str, charset) → {ByteArray}
-
Converts the String to a mutable ByteArray using the specified encoding.
Parameters:
Name Type Description str
string The string to convert
charset
String the name of the string encoding. Defaults to 'UTF-8'
- Source:
Returns:
a ByteArray representing the string
- Type
- ByteArray
-
<static> toByteString(str, charset) → {ByteString}
-
Converts the String to an immutable ByteString using the specified encoding.
Parameters:
Name Type Description str
string The string to convert
charset
String the name of the string encoding. Defaults to 'UTF-8'
- Source:
Returns:
a ByteString representing the string
- Type
- ByteString