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

Copy a byte range from one blob into another at a destination offset&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
copy(
    xref:BloombergLP/bdlbb/Blob.adoc[Blob]* dst,
    int dstOffset,
    xref:BloombergLP/bdlbb/Blob.adoc[Blob] const& src,
    int srcOffset,
    int length);
----

== Description

Copy into the specified `dst` starting at the specified `dstOffset` the specified `length` bytes starting at the specified `srcOffset` in the specified `src`&period; The behavior is undefined unless `0 &lt;&equals; dstOffset`, `0 &lt;&equals; srcOffset`, `0 &lt;&equals; length`, `dst &verbar;&verbar; 0 &equals;&equals; length`, `!dst &verbar;&verbar; dstOffset &lt;&equals; dst&hyphen;&gt;length() &hyphen; length`, and `srcOffset &lt;&equals; src&hyphen;&gt;length() &hyphen; length`&period; Note that this operation does not require `dst` to have a blob buffer factory in that it does not create or destroy blobs &hyphen;&hyphen; it simply copies data from `src` into `dst`, so `dst` must already have room for `length` bytes of data added at `dstOffset`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dst*
| destination blob
| *dstOffset*
| starting byte offset in `dst`
| *src*
| source blob
| *srcOffset*
| starting byte offset in `src`
| *length*
| number of bytes to copy
|===


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