public static int[] unpackBits(long val) {
        int size = Long.bitCount(val);
        int[] result = new int[size];
        int index = 0;
        int bitPos = 0;
        while (val > 0) {
            if ((val & 1) == 1) result[index++] = bitPos;
            val = val >> 1;
            bitPos++;
        }
        return result;
    }
A utility class for handling unsigned integers and unsigned arithmetics, as well as syntactic
sugar methods for ByteBuffer. Useful for networking and packet manipulations.
{@hide}
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/BitUtils.java