---
name: "bson_reader_new_from_handle"
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_handle"
---

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

## SYNOPSIS

```
bson_reader_t *
bson_reader_new_from_handle (void *handle,
                             bson_reader_read_func_t rf,
                             bson_reader_destroy_func_t df);
```

## PARAMETERS

- •

  **handle**: A user-provided pointer or NULL.

- •

  **rf**: A *bson\_reader\_read\_func\_t*.

- •

  **df**: A *bson\_reader\_destroy\_func\_t*.

## DESCRIPTION

This function allows for a pluggable data stream for the reader. This can be used to read from sockets, files, memory, or other arbitrary sources.

## RETURNS

A newly allocated bson\_reader\_t if successful; otherwise NULL.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
