public final class BuiltInOperators
extends java.lang.Object
| Constructor and Description |
|---|
BuiltInOperators() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isSet(ZserioBitmask bitmaskValue,
ZserioBitmask requiredMask)
Checks whether the requiredMask is set within the bitmaskValue.
|
static int |
lengthOf(java.lang.String stringValue)
Gets length of the given string in UTF-8 bytes.
|
static short |
numBits(java.math.BigInteger numValues)
Gets the minimum number of bits required to encode
numValues different values. |
static short |
numBits(long numValues)
Gets the minimum number of bits required to encode
numValues different values. |
public static boolean isSet(ZserioBitmask bitmaskValue, ZserioBitmask requiredMask)
This method implements Zserio built-in operator isset for Zserio bitmask types.
Example:
issset(bitmaskField, Bitmask.READ)bitmaskValue - Bitmask value to check.requiredMask - Mast to use.public static short numBits(long numValues)
numValues different values.
This method implements Zserio built-in operator numbits for Zserio uint8, uint16
and uint32 types.
Note: Please note that this method returns 0 if value is zero or negative value.
Examples:
numbits(0) = 0numbits(1) = 1numbits(2) = 1numbits(3) = 2numbits(4) = 2numbits(8) = 3numbits(16) = 4numValues - The number of different values from which to calculate number of bits.numValues different values.public static short numBits(java.math.BigInteger numValues)
numValues different values.
This method implements Zserio built-in operator numbits for Zserio uint64 type
which is mapped to Java BigInteger type.
Examples:
numbits(0) = 0numbits(1) = 1numbits(2) = 1numbits(3) = 2numbits(4) = 2numbits(8) = 3numbits(16) = 4numValues - The number of different values from which to calculate number of bits.numValues different values.public static int lengthOf(java.lang.String stringValue)
stringValue - String value.Last updated 2025-10-02 14:26:25