[#BIO_new_mem_buf]
= BIO&lowbar;new&lowbar;mem&lowbar;buf
:mrdocs:

Create a read&hyphen;only memory BIO that reads from an existing buffer&period;

== Synopsis

Declared in `&lt;openssl&sol;bio&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BIO.adoc[BIO]*
BIO&lowbar;new&lowbar;mem&lowbar;buf(
    void const* buf,
    int len);
----

== Return Value

New memory BIO, or NULL on error&semi; free with BIO&lowbar;free()&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buf*
| Pointer to `len` bytes of data (not copied&semi; must remain valid for the BIO&apos;s life)&period;
| *len*
| Length of `buf` in bytes, or &hyphen;1 to use strlen(`buf)&period;`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
