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

Utility for encoding and decoding primitive BER constructs and values&period;

== Synopsis

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

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

== Description

This utility contains functions to encode and decode primitive BER constructs and simple value semantic types&period; By convention, all functions return 0 on success, and a non&hyphen;zero value otherwise&period; Also by convention, all the &quot;get&quot; functions take an `accumNumBytesConsumed`&semi; each of the functions will add to this variable the number of bytes consumed within the scope of the function&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil/_04enum.adoc[`Unnamed enum`] 
| Constants used as BER length sentinels&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balber/BerUtil/getEndOfContentOctets.adoc[`getEndOfContentOctets`] 
| Decode BER end&hyphen;of&hyphen;content octets from `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/getIdentifierOctets.adoc[`getIdentifierOctets`] 
| Decode BER identifier octets from `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/getLength.adoc[`getLength`] 
| Decode BER length octets from `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/getValue-0b.adoc[`getValue`] 
| `getValue` overloads
| xref:BloombergLP/balber/BerUtil/putEndOfContentOctets.adoc[`putEndOfContentOctets`] 
| Encode the &quot;end&hyphen;of&hyphen;content&quot; octets (two consecutive zero&hyphen;octets) to the specified `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/putIdentifierOctets.adoc[`putIdentifierOctets`] 
| Encode the identifier octets for the specified `tagClass`, `tagType` and `tagNumber` to the specified `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/putIndefiniteLengthOctet.adoc[`putIndefiniteLengthOctet`] 
| Encode the BER indefinite&hyphen;length octet to `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/putLength.adoc[`putLength`] 
| Encode the specified `length` to the specified `streamBuf`&period;
| xref:BloombergLP/balber/BerUtil/putValue.adoc[`putValue`] 
| Encode the specified `value` to the specified `streamBuf`&period;
|===



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