62
edits
(export Binary too!) |
(move join the ByteString constructor, remove toString(charset)) |
||
| Line 33: | Line 33: | ||
; ByteString(string, charset) | ; ByteString(string, charset) | ||
: Convert a string. The ByteString will contain string encoded with charset. | : Convert a string. The ByteString will contain string encoded with charset. | ||
=== Constructor methods === | |||
; <u>join(array, delimiter)</u> | |||
: Like Array.prototype.join, but for Binarys. Returns a ByteString. | |||
=== Instance properties === | === Instance properties === | ||
| Line 54: | Line 59: | ||
: Returns an array containing the decoded Unicode code points. | : Returns an array containing the decoded Unicode code points. | ||
; toString() | ; toString() | ||
: Returns a debug representation like "[ByteString 10]", where 10 is the length of the Array. | : Returns a debug representation like "[ByteString 10]", where 10 is the length of the Array. Alternative debug representations are valid too, as long as (1) this method will never fail, (2) the length is included. | ||
; decodeToString(charset) | ; decodeToString(charset) | ||
: Returns the decoded ByteArray as a string. | : Returns the decoded ByteArray as a string. | ||
| Line 129: | Line 134: | ||
: an array of the code points, decoded | : an array of the code points, decoded | ||
; toString() | ; toString() | ||
: | : A string debug representation like "[ByteArray 10]". Alternative debug representations are valid too, as long as (1) this method will never fail, (2) the length is included. | ||
; decodeToString() | ; decodeToString() | ||
; decodeToString(charset) | ; decodeToString(charset) | ||
| Line 145: | Line 148: | ||
; <u>byteAt(offset)</u> | ; <u>byteAt(offset)</u> | ||
; concat(other:ByteArray|ByteString|Array) | ; concat(other:ByteArray|ByteString|Array) | ||
; pop() -> byte:Number | ; pop() -> byte:Number | ||
; push(...variadic Numbers...)-> count:Number | ; push(...variadic Numbers...)-> count:Number | ||
| Line 179: | Line 180: | ||
; toByteString(charset) | ; toByteString(charset) | ||
: Converts an array of Unicode code points to a ByteString encoded in charset. | : Converts an array of Unicode code points to a ByteString encoded in charset. | ||
== General Requirements == | == General Requirements == | ||
edits