Class BitShifter

java.lang.Object
net.messagevortex.router.operation.BitShifter

public class BitShifter extends Object

Shifts bits circularly.

  • Constructor Details

    • BitShifter

      public BitShifter()
  • Method Details

    • rshift

      public static int rshift(int value, int shift, byte length)

      shifts bits circularly right.

      Parameters:
      value - the value to be shifted
      shift - the number of positions to be shifted
      length - the length of the circular buffer
      Returns:
      the new value
    • lshift

      public static int lshift(int value, int shift, byte length)

      shifts bits circularly left.

      Parameters:
      value - the value to be shifted
      shift - the number of positions to be shifted
      length - the length of the circular buffer
      Returns:
      the new value