[#BloombergLP-balber-BerUtil_IntegerImpUtil-putIntegerGivenLength] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::xref:BloombergLP/balber/BerUtil_IntegerImpUtil.adoc[BerUtil_IntegerImpUtil]::putIntegerGivenLength :relfileprefix: ../../../ :mrdocs: Write exactly the specified `length` number of contents octets of the BER encoding of the specified integer `value` (as defined in the specification) to the output sequence of the specified `streamBuf`. Return 0 if successful, and a non‐zero value otherwise. The operation succeeds if all bytes corresponding to the contents octets are written to the `streamBuf` without the write position becoming unavailable. The behavior is undefined unless there are exactly `length` number of contents octets used to encode the integer `value` according to the specification. The program is ill‐formed unless the specified `INTEGRAL_TYPE` is a fundamental integral type. == Synopsis Declared in `<balber_berutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename INTEGRAL_TYPE> static int putIntegerGivenLength( std::streambuf* streamBuf, INTEGRAL_TYPE value, int length); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#