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

Return the buffer index and in&hyphen;buffer offset for a blob position&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:bsl/pair-0b.adoc[bsl::pair&lt;int, int&gt;]
findBufferIndexAndOffset(
    xref:BloombergLP/bdlbb/Blob.adoc[Blob] const& blob,
    int position);
----

== Description

Return a value, designated here as `p`, such that for the specified `blob`, `blob&period;buffer(p&period;first)` is the buffer that contains the byte at the specified `position` in `blob`, and `p&period;second` is the offset corresponding to `position` within said buffer&period; The behavior of this function is undefined unless `0 &lt;&equals; position`, `0 &lt; blob&period;totalSize()`, and `position &lt; blob&period;totalSize()`&period; Note that (1) subsequent changes to `blob` may invalidate the result of this function, and (2) `p&period;first` never indicates a zero&hyphen;size buffer&period;

== Return Value

pair of buffer index and in&hyphen;buffer offset for `position`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *blob*
| blob in which the position is located
| *position*
| byte position within `blob`
|===


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