
Facilitates efficient manipulation of binary data with various BitArray implementations, using types like Byte, Short, Int, and Long, supporting mutable and immutable operations.
BitArray for Kotlin Common Library contains:
Byte
Short
Int
Long
ByteArray
ShortArray
IntArray
LongArray
All classes implements BitArray. All classes is value class.
dependencies {
implementation("pw.binom:bitarray:0.2.8")
}var array = BitArray32() // or BitArray64
array = array.update(index = 1, value = true)
println("value is ${array[1]}")val array = BytesBitArray(6) // or LongsBitArray(LongArray(3))
array[1] = true // was modified current value without reassign `array` variable
println("value is ${array[1]}")
val array2 = array.update(index = 1, value = false)// creates new array
println("value is ${array[1]}") // prints "false"
println("value is ${array2[1]}") // prints "true"BitArray for Kotlin Common Library contains:
Byte
Short
Int
Long
ByteArray
ShortArray
IntArray
LongArray
All classes implements BitArray. All classes is value class.
dependencies {
implementation("pw.binom:bitarray:0.2.8")
}var array = BitArray32() // or BitArray64
array = array.update(index = 1, value = true)
println("value is ${array[1]}")val array = BytesBitArray(6) // or LongsBitArray(LongArray(3))
array[1] = true // was modified current value without reassign `array` variable
println("value is ${array[1]}")
val array2 = array.update(index = 1, value = false)// creates new array
println("value is ${array[1]}") // prints "false"
println("value is ${array2[1]}") // prints "true"