Class ByteUtil

java.lang.Object
org.drasyl.util.ByteUtil

public final class ByteUtil extends Object
Utility class for operations on bytes.
  • Method Details

    • numberOfLeadingZeros

      public static int numberOfLeadingZeros(byte b)
      Returns the number of leading zero bits (highest-order / "leftmost") of the specified byte 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 specified byte 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