BitArray64

value class BitArray64(value: Long) : BitArray

Implements bitset based on Long. Index 0 is the most left bit. For example: index 30 in value 0b010 is 1, index 31 and 29 is 0

Example:

var data = Bitset64()
assertFalse(data[0])
assertFalse(data[1])
data = data.set(0,true)
assertTrue(data[0])
assertFalse(data[1])

Constructors

Link copied to clipboard
fun BitArray64(value: Long = 0)

Functions

Link copied to clipboard
open override fun full(value: Boolean, startIndex: Int, endIndex: Int): BitArray64
Link copied to clipboard
open operator override fun get(index: Int): Boolean
Link copied to clipboard
open override fun getByte4(index: Int): Byte

Returns byte from 4 bites using index

Link copied to clipboard
open override fun getByte8(index: Int): Byte

Returns byte from 8 bites using index

Link copied to clipboard
open override fun inverted(): BitArray64
Link copied to clipboard
open operator override fun iterator(): BitArrayListIterator
Link copied to clipboard
open fun toByteArray(): BooleanArray
Link copied to clipboard
fun toLong(): Long
Link copied to clipboard
open override fun toString(): String

Returns value as unsigned int in radix 2

Link copied to clipboard
fun toULong(): ULong
Link copied to clipboard
open override fun update(index: Int, value: Boolean): BitArray64
Link copied to clipboard
open override fun updateByte4(index: Int, value: Byte): BitArray64

Sets 4 bits value to this inline value using offset index. value must be less or equals 0xF

Properties

Link copied to clipboard
open val lastIndex: Int
Link copied to clipboard
open override val size: Int
Link copied to clipboard
val value: Long = 0