Skip to content
ChaosPandion edited this page Feb 2, 2011 · 3 revisions

Implements

  • Iterable

Constructor


new UInt8Buffer()

Initialize a new UInt8Buffer with a default size of 4.


new UInt8Buffer(size)

Initialize a new UInt8Buffer with a size specified by the Number parameter size.

  • If size is not a positive 32-bit integer a RangeError will be thrown.

new UInt8Buffer(iterable)

If the first parameter implements the Iterable interface a new UInt8Buffer will be returned that contains each element treated as an unsigned 8-bit integer.

  • If any element has a Number value that is greater than 255 a RangeError will be thrown.

new UInt8Buffer(Any)

Any other argument pattern will throw a TypeError.

Instance Properties


length

This property is a Number value that describes the current length of the UInt8Buffer.


createIterator()

This property is a Function that returns an object that implements the Iterator interface.


resize(newSize)

This property is a Function that will set the length of the UInt8Buffer.

  • If the newSize is not a positive 32-bit integer a RangeError will be thrown.

get(index)

This property is a Function that will get the value of UInt8Buffer at the index specified.

  • If the index is not a positive 32-bit integer that is less than the length of the UInt8Buffer a RangeError will be thrown.

get(startIndex, endIndex)

This property is a Function that will return an Iterable object that contains the elements of the UInt8Buffer from startIndex to endIndex.

  • If startIndex is not a positive 32-bit integer a RangeError will be thrown.
  • If endIndex is not a positive 32-bit integer a RangeError will be thrown.
  • If endIndex is less than startIndex a RangeError will be thrown.

set(index, value)

This property is a Function that will set the value of UInt8Buffer at the index specified.

  • If the index is not a positive 32-bit integer a RangeError will be thrown.
  • If value is not an unsigned 8-bit integer a RangeError will be thrown.

set(index, iterable)

This property is a Function that will set the value of UInt8Buffer starting at the index specified and will continue for the length of the iterable.

  • If the index is not a positive 32-bit integer a RangeError will be thrown.
  • If iterable is longer than the length of the UInt8Buffer a RangeError will be thrown.
Clone this wiki locally