code: func (bv *BitVector) writeClearedDgaps(output store.IndexOutput) error {
  	err := store.Stream(output).
  		WriteInt(-1). // mark using d-gaps
  		WriteInt(int32(bv.size)).
  		WriteInt(int32(bv.Count())).
  		Close()
  	if err != nil {
  		return err
  	}
  	last, numCleared := 0, bv.size-bv.Count()
  	for i, v := range bv.bits {
  		if v == byte(0xff) {
  			continue
  		}
  		err = output.WriteVInt(int32(i - last))
  		if err == nil {
  			err = output.WriteByte(v)
  		}
  		if err != nil {
  			return err
  		}
  		last = i
  		numCleared -= (8 - util.BitCount(v))
  		assert(numCleared >= 0 ||
  			i == len(bv.bits)-1 && numCleared == -(8-(bv.size&7)))
  		if numCleared <= 0 {
  			break
  		}
  	}
  	return nil
  }
docs: /* Write as a d-gaps list */