Package org.drasyl.util
Class ByteUtil
java.lang.Object
org.drasyl.util.ByteUtil
Utility class for operations on bytes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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
-