Package org.drasyl.util
Class ByteUtil
- java.lang.Object
-
- org.drasyl.util.ByteUtil
-
public final class ByteUtil extends Object
Utility class for operations on bytes.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
numberOfLeadingZeros(byte b)
Returns the number of leading zero bits (highest-order / "leftmost") of the specifiedbyte
value.static int
numberOfTrailingZeros(byte b)
Returns the number of trailing zero bits (lowed-order / "rightmost") of the specifiedbyte
value.
-
-
-
Method Detail
-
numberOfLeadingZeros
public static int numberOfLeadingZeros(byte b)
Returns the number of leading zero bits (highest-order / "leftmost") of the specifiedbyte
value.- Parameters:
b
- the value whose number of leading zeros is to be computed- Returns:
- the number of leading zero bits of the specified
byte
value
-
numberOfTrailingZeros
public static int numberOfTrailingZeros(byte b)
Returns the number of trailing zero bits (lowed-order / "rightmost") of the specifiedbyte
value.- Parameters:
b
- the value whose number of trailing zeros is to be computed- Returns:
- the number of trailing zero bits of the specified
byte
value
-
-