BitArray class

Bit array to store bits.

Constructors

BitArray(int length)
Creates a bit array with maximum length items.
factory
BitArray.fromByteBuffer(int length, ByteBuffer buffer)
Creates a bit array using a byte buffer.
factory
BitArray.fromUint8List(int length, Uint8List list)
Creates a bit array using a Uint8List.
factory
BitArray.parseBinary(String bitString)
Create a bit array from a binary string.
factory

Properties

byteBuffer ByteBuffer
The backing, mutable byte buffer of the BitArray. Use with caution.
no setter
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Whether the BitArray is empty == has only zero values.
no setter
isNotEmpty bool
Whether the BitArray is not empty == has set values.
no setter
length int
The number of bit in this BitArray.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asUint32Iterable() Iterable<int>
Returns an iterable wrapper of the bit array that iterates over the index numbers and returns the 32-bit int blocks.
clearAll() → void
Sets all of the bits in the current BitArray to false.
clearBit(int index) → void
Sets the bit specified by the index to false.
clearBits(Iterable<int> indexes) → void
Sets the bits specified by the indexes to false.
clone() BitArray
Creates a copy of the current BitArray.
invertAll() → void
Inverts all the bit values in the current BitArray.
invertBit(int index) → void
Inverts the bit specified by the index.
invertBits(Iterable<int> indexes) → void
Inverts the bits specified by the indexes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAll() → void
Sets all the bit values in the current BitArray to true.
setBit(int index) → void
Sets the bit specified by the index to true.
setBits(Iterable<int> indexes) → void
Sets the bits specified by the indexes to true.
toBinaryString() String
Creates a string of 0s and 1s of the content of the array.
toJson() List<int>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](int index) bool
The value of the bit with the specified index.
operator []=(int index, bool value) → void
Sets the bit specified by the index to the value.