ServerJS/Binary/B: Difference between revisions

Jump to navigation Jump to search
→‎Specification: convert more methods to a definition list (ultimately all methods should be converted like this)
m (→‎Specification: add sub-headings)
(→‎Specification: convert more methods to a definition list (ultimately all methods should be converted like this))
Line 33: Line 33:
=== Instance properties ===
=== Instance properties ===


* immutable length property
; length
: The length in bytes. Immutable.


=== Instance methods (in prototype) ===
=== Instance methods (in prototype) ===


* toByteArray() -> byte for byte
; toByteArray()
* toByteArray(sourceCodec, targetCodec) -> transcoded
: Returns a byte for byte copy in a ByteArray.
* toByteString() -> copy
; toByteArray(sourceCodec, targetCodec)
* toByteString(sourceCodec, targetCodec) -> transcoded
: Returns a transcoded copy in a ByteArray.
* toArray() -> byte value array
; toByteString()
* toArray(codec) -> decoded code point array
: Copy.
* toString() -> a representation like "[ByteString 10]"
; toByteString(sourceCodec, targetCodec)
* toString(codec) -> decoded
: Returns a transcoded copy.
; toArray()
: Returns an array containing the bytes as numbers.
; toArray(codec)
: Returns an array containing the decoded Unicode code points.
; toString()
: Returns a debug representation like "[ByteString 10]", where 10 is the length of the Array.
; toString(codec)
: ''CONTROVERSIAL'' Returns the decoded ByteArray as a string.
 
 
 
* indexOf(byte:Number|ByteString|ByteArray)
* indexOf(byte:Number|ByteString|ByteArray)
* indexOf(byte:Number|ByteString|ByteArray, start:Number)
* indexOf(byte:Number|ByteString|ByteArray, start:Number)
62

edits

Navigation menu