public Builder add(long l) {if (pending == null) {throw new IllegalStateException("Cannot be reused after build()");}if (pendingOff == pending.length) {if (values.length == valuesOff) {final int newLength = ArrayUtil.oversize(valuesOff + 1, 8);grow(newLength);}pack();}pending[pendingOff++] = l;size += 1;return this;}
public virtual Builder Add(int doc){if (doc <= previousDoc){throw new System.ArgumentException("Doc IDs must be provided in order, but previousDoc=" + previousDoc + " and doc=" + doc);}buffer[bufferSize++] = doc - previousDoc - 1;if (bufferSize == BLOCK_SIZE){EncodeBlock();bufferSize = 0;}previousDoc = doc;++cardinality;return this;}