[#BloombergLP-bdlbb-Blob-replaceDataBuffer]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlbb.adoc[bdlbb]::xref:BloombergLP/bdlbb/Blob.adoc[Blob]::replaceDataBuffer
:relfileprefix: ../../../
:mrdocs:

Replace the data buffer at the specified `index` with `buffer`&period;

== Synopsis

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

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

== Description

The behavior is undefined unless `0 &lt;&equals; index &lt; numDataBuffers()` and the total size of the resulting blob does not exceed `INT&lowbar;MAX`&period; Note that this operation is equivalent to&colon; &grave; blob&period;removeBuffer(index)&semi; const int n &equals; blob&period;length()&semi; blob&period;insertBuffer(index, buffer)&semi; blob&period;setLength(n &plus; buffer&period;size())&semi; &grave; but is more efficient&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *index*
| position of the data buffer to replace
| *buffer*
| blob buffer that replaces the data buffer at `index`
|===


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