Skip to content

BooleanVector

A Vector of Boolean elements (BSON's PackedBitVector).

The different bytes can be extracted with toArray.

Alternatively, this class implements List.

Constructors

BooleanVector

constructor(booleans: Collection<Boolean>)
constructor(vararg booleans: Boolean)
@LowLevelApi



constructor(raw: ByteArray, padding: Byte)

Constructs a BooleanVector from the raw byte contents with a given padding.

Note that raw is only the data part of the vector. It is not the entire binary data. To construct a BooleanVector from binary data, see Vector.fromBinaryData.

Types

Serializer

@LowLevelApi



object Serializer : KSerializer<BooleanVector> 

Properties

padding

@LowLevelApi



open override val padding: Byte

The number of bits in the final byte of raw that are to be ignored.

This is useful for types that don't fit in multiples of 8 bits.

For more information on this field, read the specification.

raw

@LowLevelApi



open override val raw: ByteArray

The raw data stored in this vector.

When reading this property, remember to take into account any declared <strong>padding</strong>!

For more information on this field, read the specification.

size

open override val size: Int

type

@LowLevelApi



open override val type: Byte

The type of the elements in the vector (called dtype in the specification).

Currently, the following types are implemented:

In most situations, users of this library should use is checks with one of the implementing subclasses rather than attempting to match on this property.

Functions

contains

open operator override fun contains(element: Boolean): Boolean

containsAll

open override fun containsAll(elements: Collection<Boolean>): Boolean

equals

open operator override fun equals(other: Any?): Boolean

get

open operator override fun get(index: Int): Boolean

hashCode

open override fun hashCode(): Int

indexOf

open override fun indexOf(element: Boolean): Int

isEmpty

open override fun isEmpty(): Boolean

iterator

open operator override fun iterator(): BooleanIterator

lastIndexOf

open override fun lastIndexOf(element: Boolean): Int

listIterator

open override fun listIterator(): ListIterator<Boolean>
open override fun listIterator(index: Int): ListIterator<Boolean>

subList

open override fun subList(fromIndex: Int, toIndex: Int): List<Boolean>

toArray

toBinaryData

@LowLevelApi



open fun toBinaryData(): ByteArray

Converts this Vector into a ByteArray that fits into the content of BsonType.BinaryData.

Vector is the binary subtype 0x09.

toString

open override fun toString(): String