Here you can find the source of unpackw(int[] sourcearray, int arraypos, int[] data, int num, int b)
protected static int unpackw(int[] sourcearray, int arraypos, int[] data, int num, int b)
//package com.java2s; /**/*from w w w . j a v a 2 s .c o m*/ * This code is released under the * Apache License Version 2.0 http://www.apache.org/licenses/. * * (c) Daniel Lemire, http://lemire.me/en/ */ public class Main { protected static int unpackw(int[] sourcearray, int arraypos, int[] data, int num, int b) { int howmanyfit = 32 / b; if (num > howmanyfit) { System.arraycopy(sourcearray, arraypos, data, 0, num); return num + arraypos; } final int mask = (1 << b) - 1; int val = sourcearray[arraypos]; for (int k = 0; k < num; ++k) { data[k] = (val & mask); val >>>= b; } return arraypos + 1; } }