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

Name

Description

buf

Pointer to len bytes of data (not copied; must remain valid for the BIO's life).

len

Length of buf in bytes, or ‐1 to use strlen(buf).

Created with MrDocs