BooleanVector¶
@Serializable
(with = BooleanVector.Serializer::class)class BooleanVector : Vector, Iterable<Boolean> , Collection<Boolean> , List<Boolean>
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)
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¶
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¶
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¶
type¶
The type of the elements in the vector (called dtype in the specification).
Currently, the following types are implemented:
-
0x03:ByteVector -
0x27:FloatVector -
0x10:BooleanVector
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¶
containsAll¶
open override fun containsAll(elements: Collection<Boolean>): Boolean
equals¶
get¶
hashCode¶
indexOf¶
isEmpty¶
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¶
toArray¶
fun toArray(): BooleanArray
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.