User Tools

Site Tools


ByteArray

Script wrapper for QByteArray.

More...

Inherits :

Properties

Constructors

DAZ Script
ByteArray ()
ByteArray ( ByteArray byteArray )
ByteArray ( String str )

Methods

DAZ Script
NumberbyteAt ( Number index )
StringcharAt ( Number index )
StringconvertToString ()
StringconvertToStringFromUtf16 ()
StringconvertToStringFromUtf8 ()
ByteArrayfromBase64 ( ByteArray base64 )
ByteArrayfromHex ( ByteArray hexEncoded )
ByteArrayfromPercentEncoding ( ByteArray pctEncoded )
ByteArraytoBase64 ()
ByteArraytoHex ()
ByteArraytoPercentEncoding ( ByteArray exclude=ByteArray, ByteArray include=ByteArray )

Detailed Description

This is the script counterpart to the QByteArray type used in the C++ SDK.

Attention:

  • Inheritance will change to Object in a pending update.

Properties


Number : length

The number of bytes in the array


Number : size

The number of bytes in the array

Constructors


ByteArray()

Default Constructor.


ByteArray( ByteArray byteArray )

Copy Constructor.

Parameter(s):

  • byteArray - The ByteArray to copy.

ByteArray( String str )

Creates a byte array containing the ascii representation of the string.

Parameter(s):

  • str - The string to copy into the byte array.

Methods


Number : byteAt( Number index )

Parameter(s):

  • index - The index of the byte to return.

Return Value:

  • The byte at the given index in the array of bytes.

String : charAt( Number index )

Parameter(s):

  • index - The index of the byte to return.

Return Value:

  • The character at the given index in the array of bytes.

String : convertToString()

Return Value:

  • The array of bytes as a string.

String : convertToStringFromUtf16()

Return Value:

  • The array of bytes as a string.

String : convertToStringFromUtf8()

Return Value:

  • The array of bytes as a string.

ByteArray : fromBase64( ByteArray base64 )

Return Value:

  • A decoded copy of the Base64 encoded array base64.

Attention:

  • Input is not checked for validity; invalid characters in the input are skipped, enabling the decoding process to continue with subsequent characters.

Since:

  • 4.10.0.88

ByteArray : fromHex( ByteArray hexEncoded )

Return Value:

  • A decoded copy of the hexidecimal encoded array hexEncoded.

Attention:

  • Input is not checked for validity; invalid characters in the input are skipped, enabling the decoding process to continue with subsequent characters.

Since:

  • 4.10.0.88

ByteArray : fromPercentEncoding( ByteArray pctEncoded )

Return Value:

  • A decoded copy of the URI/URL-style percent-encoded pctEncoded.

Since:

  • 4.10.0.88

ByteArray : toBase64()

Return Value:

  • A copy of the byte array, encoded as Base64.

Attention:

  • The algorithm used to encode Base64-encoded data is defined in RFC 2045.

Since:

  • 4.10.0.88

ByteArray : toHex()

Return Value:

  • A hexidecimal encoded copy of the byte array.

Attention:

  • Hexidecimal encoding uses the numbers 0-9 and the letters a-f.

Since:

  • 4.10.0.88

ByteArray : toPercentEncoding( ByteArray exclude=ByteArray, ByteArray include=ByteArray )

Parameter(s):

  • exclude - To characters to prevent from being encoded.
  • exclude - To characters to force being encoded.

Return Value:

  • A URI/URL-style percent-encoded copy of this byte array.

Attention:

  • By default, this function will encode all characters that are not one of the following: ALPHA (“a” to “z” and “A” to “Z”) / DIGIT (0 to 9) / “-” / “.” / “_” / “~”

Since:

  • 4.10.0.88