[#BloombergLP-balber-BerUtil_RawIntegerImpUtil-putIntegerGivenLength]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::xref:BloombergLP/balber/BerUtil_RawIntegerImpUtil.adoc[BerUtil&lowbar;RawIntegerImpUtil]::putIntegerGivenLength
:relfileprefix: ../../../
:mrdocs:

Encode the octets used in the BER encoding of the specified `value` of the specified `INTEGRAL&lowbar;TYPE` to the specified `streamBuf`, using exactly the specified `length` number of octets&period; Return 0 on success, and a non&hyphen;zero value otherwise&period; The behavior is undefined unless `INTEGRAL&lowbar;TYPE` is fundamental integral type and exactly `length` number of octets is used in the BER encoding of the specified `value`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename INTEGRAL&lowbar;TYPE&gt;
static
int
putIntegerGivenLength(
    std::streambuf* streamBuf,
    INTEGRAL&lowbar;TYPE value,
    int length);
----


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