Skip to content

caffeine-mgn/bitarray

Repository files navigation

BitArray

GitHub license Kotlin 1.9.24 Gradle build

Description

BitArray for Kotlin Common Library contains:

All classes implements BitArray. All classes is value class.

Integration

Gradle

dependencies {
    implementation("pw.binom:bitarray:0.2.8")
}

Examples

BitArray16/BitArray32/BitArray64

var array = BitArray32() // or BitArray64
array = array.update(index = 1, value = true)
println("value is ${array[1]}")

BytesBitArray/LongsBitArray

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"

Support targets

  • 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)