BSON_VECTOR_PA...IEW_READ_PACKED(3)
๐ BSON_VECTOR_PACKED_BIT_VIEW_READ_PACKED(3) ๐
okay so bestie, this is a libbson page (that's the manual name, slay) and it's all about copying a contiguous block of packed bytes out of a bson_vector_packed_bit_view_t. that's it. that's the whole gig. ๐
โจ SYNOPSIS โจ
bool
bson_vector_packed_bit_view_read_packed (bson_vector_packed_bit_view_t view,
uint8_t *packed_values_out,
size_t byte_count,
size_t vector_offset_bytes);
look at her. gorgeous. four arguments, returns a bool, no notes. ๐
๐ธ PARAMETERS ๐ธ
viewโ a validbson_vector_packed_bit_view_t. has to be valid, like, actually valid, not fake-valid. do not play with her.packed_values_outโ the location where the packed bytes get read to. this is where the bytes land. it's giving destination energy. ๐byte_countโ how many bytes to read. the count. of the bytes. ๐งฎvector_offset_bytesโ the byte index of the very first packed byte to read. like where you start in the vector, but in bytes.
๐ฆ DESCRIPTION ๐ฆ
so the packed bytes get copied in bulk from the view into the output pointer you handed over. bulk copy. no per-bit nonsense. we're moving blocks of bytes, periodt. โจ
now here's the little detail you need in your life: if the Vector's element count isn't a multiple of 8, then its final byte is gonna include bits that do not belong to any element. like, stray bits. squatters. ๐ and Vector validation checks that these bits are zero. so they're just sitting there being zero and not part of anything. the way that math works out is honestly iconic.
โญ RETURNS โญ
if byte_count and vector_offset_bytes overflow the bounds of the Vector, this returns false and does literally nothing else. no other action. not a single additional thing. ๐
if the parameters are in range, though? guaranteed to succeed. like, guaranteed guaranteed. on success it returns true and reads byte_count bytes into *packed_values_out. we love a reliable queen. ๐
๐ฅ SEE ALSO ๐ฅ
bson_vector_packed_bit_const_view_read_packed()bson_vector_packed_bit_view_write_packed()
(the read-only sister and the write version, iykyk ๐ซถ)
๐ AUTHOR ๐
MongoDB, Inc
๐ COPYRIGHT ๐
2009-present, MongoDB, Inc.
ngl this one's short and sweet and does exactly what it says on the tin. no cap. ๐
okay bye bestie, this page was libbson version 2.5.6, dated Oct 09 (the year got tragically truncated in the header, rip ๐ญ), and it's BSON_VECTOR_PACKED_BIT_VIEW_READ_PACKED(3) โ catch you in the next man page! ๐๐ฆ๐
๐ฆ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 ยท Apache-2.0 AND ISC AND MIT AND Zlib
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms