BloombergLP::bdlbb::BlobUtil::padToAlignment

Pad a blob so its length is a multiple of the given alignment.

Synopsis

Declared in <bdlbb_blobutil.h>

static
void
padToAlignment(
    Blob* dest,
    int alignment,
    char fillChar = '\0');

Description

Append padding bytes to the specified dest so that its resulting length is an integer multiple of the specified alignment. Optionally specify fillChar with which the padding is to be filled. If fillChar is not specified, a 0 byte will be used. The behavior is undefined unless alignment is a power of 2, and less than or equal to 64.

Parameters

NameDescription
destblob to pad
alignmentpower-of-two alignment for the resulting length
fillCharbyte value used for padding