public static FastBitSet groupingSet2BitSet(long value, int length) {
    FastBitSet bits = new FastBitSet();
    for (int index = length - 1; index >= 0; index--) {
      if (value % 2 != 0) {
        bits.set(index);
      }
      value = value >>> 1;
    }
    return bits;
  }
This method returns the big-endian representation of value.
@param value
@param length
@return
ql/src/java/org/apache/hadoop/hive/ql/exec/GroupByOperator.java