[#BloombergLP-bdlbb-Blob-insertBuffer-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlbb.adoc[bdlbb]::xref:BloombergLP/bdlbb/Blob.adoc[Blob]::insertBuffer
:relfileprefix: ../../../
:mrdocs:

Insert the specified `buffer` at the specified `index` in this blob&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
insertBuffer(
    int index,
    xref:BloombergLP/bdlbb/BlobBuffer.adoc[BlobBuffer] const& buffer);
----

== Description

Increment the length of this blob by the size of `buffer` if `buffer` is inserted _before_ the logical end of this blob&period; The length of this blob is _unchanged_ if inserting at a position following all data buffers (e&period;g&period;, inserting into an empty blob or inserting a buffer to increase capacity)&semi; in that case, the blob length must be changed by an explicit call to `setLength`&period; Buffers at `index` and higher positions (if any) are shifted up by one index position&period; The behavior is undefined unless `0 &lt;&equals; index &lt;&equals; numBuffers()` and neither the total size of the resulting blob nor its total number of buffers exceeds `INT&lowbar;MAX`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *index*
| position at which to insert `buffer`
| *buffer*
| blob buffer to insert
|===


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