ServerJS/Binary/B: Difference between revisions

Jump to navigation Jump to search
m
m (→‎Specification: more definition lists)
Line 88: Line 88:
=== Constructor ===
=== Constructor ===


* ByteArray()
; ByteArray()
* ByteArray(length)
: New, empty ByteArray.
* ByteArray(byteArray)
; ByteArray(length)
* ByteArray(byteString)
: New ByteArray filled with length zero bytes.
* ByteArray(array)
; ByteArray(byteArray)
* ByteString(string, codec)
: Copy byteArray.
; ByteArray(byteString)
: Copy contents of byteString.
; ByteArray(arrayOfBytes)
: Use numbers in arrayOfBytes as contents.
: Throws an exception if any element is outside the range 0...255 (''TODO'').
; ByteArray(string, codec)
: Create a ByteArray from a Javascript string, the result being encoded with codec.


Unlike the Array, the ByteArray is not variadic so that its initial length constructor is not ambiguous with its copy constructor.
Unlike the Array, the ByteArray is not variadic so that its initial length constructor is not ambiguous with its copy constructor.
62

edits

Navigation menu