|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jpragma.snmp.util.BitManipulationHelper
public final class BitManipulationHelper
Utility class for bit and byte array manipulation.
| Method Summary | |
|---|---|
static boolean |
getBitValue(int value,
int bitPosition)
Returns bit value at specified position. |
static byte[] |
intToByteArray(int number)
Converts int to byte array. |
static byte[] |
mergeArrays(byte[] buf1,
byte[] buf2)
Merges two byte arrays. |
static byte[] |
removeLeadingZeroBytes(byte[] buf)
Removes leading bytes with 0 value. |
static int |
setBitValue(int value,
int bitPosition,
boolean bitValue)
Sets bit at specified position. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean getBitValue(int value,
int bitPosition)
value - original numberbitPosition - 1st bit is 1, last bit is 32
public static int setBitValue(int value,
int bitPosition,
boolean bitValue)
value - original numberbitPosition - bitPosition 1st bit is 1, last bit is 32bitValue - true to turn the bit on
public static byte[] intToByteArray(int number)
number - original number
public static byte[] removeLeadingZeroBytes(byte[] buf)
buf - original byte array
public static byte[] mergeArrays(byte[] buf1,
byte[] buf2)
buf1 - First byte arraybuf2 - Second byte array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||