[#BloombergLP-bdlbb-BlobUtil-prependWithCapacityBuffer]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlbb.adoc[bdlbb]::xref:BloombergLP/bdlbb/BlobUtil.adoc[BlobUtil]::prependWithCapacityBuffer
:relfileprefix: ../../../
:mrdocs:

Prepend bytes to `dest`, preferring existing then spare capacity&period;

== Synopsis

Declared in `&lt;bdlbb&lowbar;blobutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
prependWithCapacityBuffer(
    xref:BloombergLP/bdlbb/Blob.adoc[Blob]* dest,
    xref:BloombergLP/bdlbb/BlobBuffer.adoc[BlobBuffer]* buffer,
    char const* source,
    int length);
----

== Description

Prepend the specified `length` bytes from the specified `source` address to the specified `dest`&period; Use the existing capacity in `dest` first if `0 &equals;&equals; dest&hyphen;&gt;length()`, followed by that in the `buffer`, and finally allocate from the blob buffer factory associated with the `dest`&period; Load any unused space into the specified `buffer`&period; The behavior is undefined unless the range `&lsqb;source, source &plus; length)&rsqb;` represents a readable sequence of memory&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dest*
| destination blob
| *buffer*
| in&sol;out spare capacity buffer
| *source*
| contiguous source address
| *length*
| number of bytes to prepend
|===


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