BitArray for Kotlin Common Library contains:
- BitArray8 based in
Byte - BitArray16 based in
Short - BitArray32 based in
Int - BitArray64 based on
Long - BytesBitArray based on
ByteArray - ShortsBitArray based on
ShortArray - IntsBitArray based on
IntArray - LongsBitArray based on
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"- Jvm
- Linux x64
- Linux Arm32Hfp
- Linux Arm64
- Linux Mips32
- Linux Mipsel32
- Mingw x64
- Mingw x86
- Android Native Arm32
- Android Native Arm64
- Android Native x86
- Android Native x64
- Macos x64
- Macos Arm64
- IOS
- IOS Arm32
- IOS Arm64
- IOS Simulator Arm64
- WatchOS
- WatchOS Arm32
- WatchOS Arm64
- WatchOS Simulator Arm64
- WatchOS x64
- WatchOS x86
- Wasm32
- Wasm
- JS (Legacy and IR)