[#BloombergLP-balber-BerUtil_IntegerImpUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balber.adoc[balber]::BerUtil&lowbar;IntegerImpUtil
:relfileprefix: ../../
:mrdocs:

This component&hyphen;private utility `struct` provides a namespace for a suite of functions used by `BerUtil` to implement BER encoding and decoding operations for integer values&period; Within the definition of this `struct`&colon;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct BerUtil&lowbar;IntegerImpUtil;
----

== Description

&ast; *the specification*&colon; &gt; Refers to the August 2015 revision of the ITU&hyphen;T Recommendation X&period;690&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/Constants.adoc[`Constants`] 
| `Constants` is an alias to a namespace for a suite of general&hyphen;purpose constants that occur when encoding or decoding BER data&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/LengthImpUtil.adoc[`LengthImpUtil`] 
| `LengthUtil` is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/RawIntegerUtil.adoc[`RawIntegerUtil`] 
| `RawIntegerUtil` is an alias to a namespace for a suite of low&hyphen;level functions used to implement BER encoding operations for integer values&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/StreambufUtil.adoc[`StreambufUtil`] 
| `StreambufUtil` is an alias to a namespace for a suite of functions used to implement input and output operations on `bsl&colon;&colon;streambuf` objects&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/get40BitIntegerValue.adoc[`get40BitIntegerValue`] 
| Read 5 bytes from the input sequence of the specified `streamBuf` and load to the specified `value` the interpretation of those bytes as a 40&hyphen;bit, signed, 2&apos;s&hyphen;complement, big&hyphen;endian integer&period; Return 0 if successful, and a non&hyphen;zero value otherwise&period; The operation succeeds if all 5 bytes are successfully read from the input sequence of the `streamBuf` without the read position becoming unavailable, and the bytes read contain a valid representation of a 40&hyphen;bit, signed, 2&apos;s&hyphen;complement, big&hyphen;endian integer&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/getIntegerValue-02.adoc[`getIntegerValue`] 
| `getIntegerValue` overloads
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/getNumOctetsToStream-0e.adoc[`getNumOctetsToStream`] 
| `getNumOctetsToStream` overloads
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/put40BitIntegerValue.adoc[`put40BitIntegerValue`] 
| Write the 5 octets that comprise the 40&hyphen;bit, signed, 2&apos;s&hyphen;complement, bit&hyphen;endian representation of the specified integer `value` to the specified `streamBuf`&period; Return 0 if successful, and a non&hyphen;zero value otherwise&period; The operation succeeds if all bytes corresponding to the representation of the `value` are written to the `streamBuf` without the write position becoming unavailable&period; The behavior is undefined unless the `value` is in the half&hyphen;open interval `&lsqb;&hyphen;549755813888, 549755813888)&rsqb;`&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/putIntegerGivenLength.adoc[`putIntegerGivenLength`] 
| 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`&period; Return 0 if successful, and a non&hyphen;zero value otherwise&period; The operation succeeds if all bytes corresponding to the contents octets are written to the `streamBuf` without the write position becoming unavailable&period; The behavior is undefined unless there are exactly `length` number of contents octets used to encode the integer `value` according to the specification&period; The program is ill&hyphen;formed unless the specified `INTEGRAL&lowbar;TYPE` is a fundamental integral type&period;
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/putIntegerValue.adoc[`putIntegerValue`] 
| Write the length and contents octets of the BER encoding of the specified integer `value` (as defined in the specification) to the output sequence of the specified `streamBuf`&period; Return 0 if successful, and a non&hyphen;zero value otherwise&period; The operation succeeds if all bytes corresponding to the length and contents octets are written to the `streamBuf` without the write position becoming unavailable&period; The program is ill&hyphen;formed unless the specified `INTEGRAL&lowbar;TYPE` is a fundamental integral type&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil_IntegerImpUtil/k_40_BIT_INTEGER_LENGTH.adoc[`k&lowbar;40&lowbar;BIT&lowbar;INTEGER&lowbar;LENGTH`] 
| Number of octets used to encode a signed integer value in 40 bits&period;
|===



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