constructor
uint32 numbers to read/manipulate
Callback which is invoked when a value has changed.
Get a Uint32Bytes instance that can be used to manipulate the number that the bytes in data.buffer represents.
The number is specified by setting dataOffset. Calling mutating methods in the Uint32Bytes will trigger the _onValueChanged
callback.
and isChanged will also be changed accordingly.
Gets the offset of the number in data the Uint32Bits instance is working with
Sets the offset of the number in data the Uint32Bits instance is working with, Also resets the isChanged property to false.
Whether the number in data that dataOffset currently points to has changed since dataOffset was last called. Can only be changed by calling methods and properties on this Uint32Bits instance.
The uint32 number that the Uint32Bits instance is currently working with (specified by dataOffset).
Replace the uint32 number in data that dataOffset points to.
Will trigger _onValueChanged callback and isChanged will also be changed accordingly.
Returns the number stored at a bit up to the bit specified by bit + size.
bit
number of bits starting at bit.
The number stored at [bit, bit + size].
Check if a bit is on or off in data [dataOffset].
The bit to check-
true if bit is on. Otherwise false.
Sets a bit to 0 in data [dataOffset].
Bit to set to on/off
The current Uint32Bits instance.
Sets a bit to 1 in data [dataOffset].
Bit to set to on/off
The current Uint32Bits instance.
Set a bit to on/off in data[dataOffset].
Bit to set on/off.
truthy sets the bit 1. falsy sets it to 0.
The current Uint32Bits instance.
Store a number at bits defined by bit and bit + size. Only the first size bits of val
will be used.
bit to start storing val at.
number of bits to store val at.
Value to store
The Uint32Bits instance. Useful for chaining.
Converts data[dataOffset] to a binary string
Binary string representation (32 positions.)
StaticgetReturns the number stored at a specified bit up to the bit specified by bit + size.
The value to extract the number from.
The starting bit position.
The number of bits to extract.
The number stored at [bit, bit + size].
StatichasChecks if a bit is on or off in the given value.
The value to check.
The bit to check.
true if the bit is on, otherwise false.
StaticmaskCreates a mask with bits specified by bit to bit + size set to 1. All other bits are 0
bit
number of bits to set
mask
StaticoffSets a bit to 0 in the given value.
The original value.
The bit to set to 0.
The modified value with the bit set to 0.
StaticonSets a bit to 1 in the given value.
The original value.
The bit to set to 1.
The modified value with the bit set to 1.
StaticsetSets a bit to on/off in the given value.
The original value.
The bit to set on/off.
truthy sets the bit to 1, falsy sets it to 0.
The modified value with the bit set.
StaticsetStores a number at bits defined by bit and bit + size. Only the first size bits of val will be used.
The original value.
The starting bit position.
The number of bits to store.
The value to store.
The modified value with the number stored at the specified bits.
Statictoconverts n to a binary string
Number to convert to a binary string.
Binary string representation (32 positions.)
Provides methods to manipulate and read individual and bits in the numbers held by a a typed array
Uint32Array.