code: public static int clen(int values, int bpv) {
      int len = (values*bpv) >> 3;
      return values*bpv % 8 == 0 ? len : len + 1;
    }
docs: Returns compressed len of the given array length if the value if represented by bpv-bits.