BIO_new_mem_buf

Create a read-only memory BIO that reads from an existing buffer.

Synopsis

Declared in <openssl/bio.h>

BIO*
BIO_new_mem_buf(
    void const* buf,
    int len);

Return Value

New memory BIO, or NULL on error; free with BIO_free().

Parameters

NameDescription
bufPointer to len bytes of data (not copied; must remain valid for the BIO's life).
lenLength of buf in bytes, or -1 to use strlen(buf).