public void add(long v) throws IOException {assert PackedInts.unsignedBitsRequired(v) <= bitsPerValue;assert !finished;if (valueCount != -1 && written >= valueCount) {throw new EOFException("Writing past end of stream");}nextValues[off++] = v;if (off == nextValues.length) {flush();}++written;}
public override void Add(long v){Debug.Assert(m_bitsPerValue == 64 || (v >= 0 && v <= PackedInt32s.MaxValue(m_bitsPerValue)), m_bitsPerValue.ToString());Debug.Assert(!finished);if (m_valueCount != -1 && written >= m_valueCount){throw new System.IO.EndOfStreamException("Writing past end of stream");}nextValues[off++] = v;if (off == nextValues.Length){Flush();}++written;}