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

Copy a byte range from a blob into a contiguous destination buffer&period;

== Synopsis

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

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

== Description

Copy the specified `length` bytes starting at the specified `position` in the specified `srcBlob` to the specified `dstBuffer`&period; The behavior of this function is undefined unless `0 &lt;&equals; length`, `0 &lt;&equals; position`, `position &lt;&equals; srcBlob&period;totalSize() &hyphen; length`, and `dstBuffer` has room for `length` bytes&period; Note that this function does _not_ set `dstBuffer&lsqb;length&rsqb;` to 0&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstBuffer*
| contiguous destination buffer
| *srcBlob*
| source blob
| *position*
| starting byte offset in `srcBlob`
| *length*
| number of bytes to copy
|===


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