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

# bson\_reader\_new\_from\_data(3)

## SYNOPSIS

```
bson_reader_t *
bson_reader_new_from_data (const uint8_t *data, size_t length);
```

## PARAMETERS

- •

  **data**: A uint8\_t.

- •

  **length**: A size\_t.

## DESCRIPTION

The *bson\_reader\_new\_from\_data()* function shall create a new *bson\_reader\_t* using the buffer supplied. **data** is not copied and *MUST* be valid for the lifetime of the resulting *bson\_reader\_t*.

## RETURNS

A newly allocated *bson\_reader\_t*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
