BloombergLP::balber::BerUtil_RawIntegerImpUtil::putIntegerGivenLength

Encode the octets used in the BER encoding of the specified value of the specified INTEGRAL_TYPE to the specified streamBuf, using exactly the specified.

Synopsis

Declared in <balber_berutil.h>

template<typename INTEGRAL_TYPE>
static
int
putIntegerGivenLength(
    std::streambuf* streamBuf,
    INTEGRAL_TYPE value,
    int length);

Description

length number of octets. Return 0 on success, and a non-zero value otherwise. The behavior is undefined unless INTEGRAL_TYPE is fundamental integral type and exactly length number of octets is used in the BER encoding of the specified value.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
streamBufoutput stream buffer
valuevalue to encode
lengthnumber of content octets