Java Array Shift shiftRightN(int[] block, int n)

Here you can find the source of shiftRightN(int[] block, int n)

Description

shift Right N

License

Open Source License

Declaration

static void shiftRightN(int[] block, int n) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    static void shiftRightN(int[] block, int n) {
        int i = 0;
        int bits = 0;
        for (;;) {
            int b = block[i];
            block[i] = (b >>> n) | bits;
            if (++i == 4) {
                break;
            }/* ww  w .  j  a v  a2  s .c  o  m*/
            bits = b << (32 - n);
        }
    }
}

Related

  1. shiftRight(int[] x)
  2. shiftRight(Object[] array, final int amount)
  3. shiftRight(T[] array)
  4. shiftRight2(T[] array, int to)
  5. shiftRightN(int[] block, int n)
  6. shiftRightN(int[] x, int n)
  7. shiftRightState(int[] state)
  8. shiftStringArray(String[] input)
  9. unshift(String[] array, String newElem)