Package org.onlab.util
Class ByteOperator
- java.lang.Object
-
- org.onlab.util.ByteOperator
-
public final class ByteOperator extends java.lang.ObjectProvide a set of byte operations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleangetBit(byte value, int index)Obtains a specific bit value from a byte with given index number.static bytetoBit(boolean value, int bit)Converts boolean value into bit.
-
-
-
Method Detail
-
getBit
public static boolean getBit(byte value, int index)Obtains a specific bit value from a byte with given index number.- Parameters:
value- byte valueindex- index number- Returns:
- a specific bit value from a byte
-
toBit
public static byte toBit(boolean value, int bit)Converts boolean value into bit.- Parameters:
value- boolean valuebit- bit value- Returns:
- converted bit value
-
-