private static byte[] toBinary(BitSet bitset) {
    byte[] nulls = new byte[1 + (bitset.length() / 8)];
    for (int i = 0; i < bitset.length(); i++) {
      nulls[i / 8] |= bitset.get(i) ? MASKS[i % 8] : 0;
    }
    return nulls;
  }
Get a subset of this ColumnBuffer, starting from the 1st value.

@param end index after the last value to include
serde/src/java/org/apache/hadoop/hive/serde2/thrift/ColumnBuffer.java