MONGOC_STREAM_BUFFERED_NEW(3)
π MONGOC_STREAM_BUFFERED_NEW β¨
okay so bestie, welcome to the libmongoc manual β this one's about mongoc_stream_buffered_new, and it's genuinely such a vibe once you get it. no cap. π¦
β¨ SYNOPSIS β¨
mongoc_stream_t *
mongoc_stream_buffered_new (mongoc_stream_t *base_stream, size_t buffer_size);
that's the whole signature, queen. two args, one stream back. slay. π
π PARAMETERS π
base_streamβ amongoc_stream_tthat you want to buffer. like, this is the stream underneath, the main character that's getting wrapped. π«Άbuffer_sizeβ asize_tholding the buffer size you want. the desired one. we'll get into that. π
πΈ DESCRIPTION πΈ
okay so this function shall create a new mongoc_stream_t that buffers bytes going to and from the underlying base_stream. both directions, bestie. it's giving full duplex glamour. β¨
buffer_size is used as the initial buffer size. and here's the thing β it may grow past this size. so don't get attached to your number, it's a starting point, not a promise. π
β οΈ WARNING β οΈ β the internal buffer does not reduce in size once grown. ever. it only goes up. so if you receive a large message, you may end up with a large allocation that just persists until the returnedmongoc_stream_tis freed withmongoc_stream_destroy(). like it's not gonna shrink back down out of politeness. it's staying. π« plan accordingly, iykyk.
π RETURNS π
a newly allocated mongoc_stream_buffered_t on success. otherwise NULL β sad girl hours. π
either way: this should be freed with mongoc_stream_destroy() when it's no longer in use. don't leave her hanging, that's not the vibe. π§
π AUTHOR π
MongoDB, Inc β icons only.
π COPYRIGHT π
2009-present, MongoDB, Inc. β periodt.
and that's the page, bestie!! π this was MONGOC_STREAM_BUFFERED_NEW(3) from the libmongoc manual, version 2.5.6, dated Oct 09, 2026. go buffer something iconic. βππ¦
π¦ where this page comes from
- epel 10: mongo-c-driver-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