public class BitsHelper
extends java.lang.Object
An instance with bits 0, 3 and 10 set will have the value:
10010000 00100000
^ ^ ^
bit 0 3 10
so will consist of the two bytes (octets) 0x90 & 0x20.
See also
section 7.1.4. of
SNMPv2-SMI
and section 8. (3) of
SNMPv2-TM.| Constructor and Description |
|---|
BitsHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isFlagged(AsnOctets oct,
int index)
Returns if the flag (bit) on the specified index is set.
|
static void |
setFlagged(AsnOctets oct,
int index,
boolean toset)
Sets or unsets the flag (bit) on the specified index.
|
public static void setFlagged(AsnOctets oct, int index, boolean toset) throws java.lang.IllegalArgumentException
oct - The AsnOctets that represents the BITSindex - The index (0 - X)toset - Whether to set (true) or unset (false) the bitjava.lang.IllegalArgumentExceptionpublic static boolean isFlagged(AsnOctets oct, int index) throws java.lang.IllegalArgumentException
oct - The AsnOctets that represents the BITSindex - The index (0 - X)java.lang.IllegalArgumentException