Package org.drasyl.util
Class ByteUtil
java.lang.Object
org.drasyl.util.ByteUtil
Utility class for operations on bytes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intnumberOfLeadingZeros(byte b) Returns the number of leading zero bits (highest-order / "leftmost") of the specifiedbytevalue.static intnumberOfTrailingZeros(byte b) Returns the number of trailing zero bits (lowed-order / "rightmost") of the specifiedbytevalue.
-
Method Details
-
numberOfLeadingZeros
public static int numberOfLeadingZeros(byte b) Returns the number of leading zero bits (highest-order / "leftmost") of the specifiedbytevalue.- Parameters:
b- the value whose number of leading zeros is to be computed- Returns:
- the number of leading zero bits of the specified
bytevalue
-
numberOfTrailingZeros
public static int numberOfTrailingZeros(byte b) Returns the number of trailing zero bits (lowed-order / "rightmost") of the specifiedbytevalue.- Parameters:
b- the value whose number of trailing zeros is to be computed- Returns:
- the number of trailing zero bits of the specified
bytevalue
-