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 β€” a mongoc_stream_t that you want to buffer. like, this is the stream underneath, the main character that's getting wrapped. 🫢
  • buffer_size β€” a size_t holding 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 returned mongoc_stream_t is freed with mongoc_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.


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