You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both datatypes provide collection like functionality, although neither directly implement the Scala
collection library traits. Both are implemented as binary trees where each node is either a leaf
node containing bits/bytes or is an inner node containing an operation on other trees (e.g., append).
As a result, many operations are implemented in logarithmic time with respect to the depth of the tree.
Both strict and lazy constructors are provided. Of particular interest are the methods that work
with Java NIO sources like java.nio.channels.ReadableByteChannel and java.nio.channels.FileChannel,
which allow efficient, lazy access and manipulation of bits and bytes from a variety of sources.
Hexadecimal and binary string literals are supported via the hex and bin string interpolators.
For example:
val x: ByteVector = hex"deadbeef"
val y: BitVector = bin"00101101010010101"
Base conversions to and from strings are supported. Binary, hexadecimal, and base 64 conversions are
supported. Each have a default alphabet but support alternative alphabets as well as user defined
alphabets.