Copy a byte range from a blob into a contiguous destination buffer.

Synopsis

Declared in <bdlbb_blobutil.h>

static
void
copy(
    char* dstBuffer,
    Blob const& srcBlob,
    int position,
    int length);

Description

Copy the specified length bytes starting at the specified position in the specified srcBlob to the specified dstBuffer. The behavior of this function is undefined unless 0 <= length, 0 <= position, position <= srcBlob.totalSize() ‐ length, and dstBuffer has room for length bytes. Note that this function does not set dstBuffer[length] to 0.

Parameters

Name

Description

dstBuffer

contiguous destination buffer

srcBlob

source blob

position

starting byte offset in srcBlob

length

number of bytes to copy

Created with MrDocs