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

Set the length of this blob to the specified `length`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setLength(int length);
----

== Description

If `length` is greater than its total size, grow this blob by appending buffers allocated using this object&apos;s underlying `BlobBufferFactory`&period; The behavior is undefined if `length` is a negative value, or if the new length requires growing the blob and this blob has no underlying factory&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *length*
| new logical length of this blob, in bytes
|===


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