Class ByteOperator


  • public final class ByteOperator
    extends java.lang.Object
    Provide a set of byte operations.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getBit​(byte value, int index)
      Obtains a specific bit value from a byte with given index number.
      static byte toBit​(boolean value, int bit)
      Converts boolean value into bit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 value
        index - 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 value
        bit - bit value
        Returns:
        converted bit value