---
name: "mongoc_stream_buffered_new"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_stream_buffered_new"
---

# mongoc\_stream\_buffered\_new(3)

## SYNOPSIS

```
mongoc_stream_t *
mongoc_stream_buffered_new (mongoc_stream_t *base_stream,
                        size_t buffer_size);
```

## PARAMETERS

- •

  **base\_stream**: A *mongoc\_stream\_t* to buffer.

- •

  **buffer\_size**: A size\_t containing the desired buffer size.

This function shall create a new *mongoc\_stream\_t* that buffers bytes to and from the underlying **base\_stream**.

**buffer\_size** will be used as the initial buffer size. It may grow past this size.

## RETURNS

A newly allocated *mongoc\_stream\_buffered\_t* on success, otherwise **NULL**. This should be freed with *mongoc\_stream\_destroy()* when no longer in use.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
