Skip to content

ChunkByteOps

extensionChunkByteOpsonChunk<int>

Byte-oriented operations for Chunk<int>.

Properties

asUint8List extension no setter

Uint8ListgetasUint8List

Returns a Uint8List view of this chunk's bytes.

Returns the underlying array directly when the backing representation already is a Uint8List; otherwise copies.

Available on Chunk<O>, provided by the ChunkByteOps extension

Implementation
dart
Uint8List get asUint8List {
  return switch (this) {
    final _ByteVectorChunk bv => bv.asUint8List,
    final _Uint8ListChunk ch => ch.asUint8List,
    final _BoxedChunk<int> boxed => Uint8List.fromList(boxed._values),
    _ => Uint8List.fromList(toDartList()),
  };
}

toBitVector extension no setter

BitVectorgettoBitVector

Interprets this byte chunk as a BitVector.

Available on Chunk<O>, provided by the ChunkByteOps extension

Implementation
dart
BitVector get toBitVector => toByteVector.bits;

toByteVector extension no setter

ByteVectorgettoByteVector

Wraps this chunk as a zero-copy ByteVector view.

Available on Chunk<O>, provided by the ChunkByteOps extension

Implementation
dart
ByteVector get toByteVector => ByteVector.viewAt(At((i) => this[i]), size);