[#BloombergLP-balber-BerUtil-getLength]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::xref:BloombergLP/balber/BerUtil.adoc[BerUtil]::getLength
:relfileprefix: ../../../
:mrdocs:

Decode the length octets from the specified `streamBuf` and load the result to the specified `result`&period; If the length is indefinite (i&period;e&period;, contents will be terminated by &quot;end&hyphen;of&hyphen;content&quot; octets) then `result` will be set to `k&lowbar;INDEFINITE&lowbar;LENGTH`&period; Add the number of bytes consumed to the specified `accumNumBytesConsumed`&period; Return 0 on success, and a non&hyphen;zero value otherwise&period;

== Synopsis

Declared in `&lt;balber&lowbar;berutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
getLength(
    std::streambuf* streamBuf,
    int* result,
    int* accumNumBytesConsumed);
----


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