Example #1
0
 protected override void Swap(int i, int j)
 {
     ArrayUtil.Swap(arr, i, j);
 }
Example #2
0
 /// <summary>
 /// Used to grow the reference array.
 /// <para/>
 /// In general this should not be used as it does not take the offset into account.
 /// <para/>
 /// @lucene.internal
 /// </summary>
 public void Grow(int newLength)
 {
     Debug.Assert(Offset == 0); // NOTE: senseless if offset != 0
     bytes = ArrayUtil.Grow(bytes, newLength);
 }
Example #3
0
 /// <summary>
 /// Expand the <see cref="T:long[]"/> with the size given as a number of words (64 bit longs). </summary>
 public virtual void EnsureCapacityWords(int numWords)
 {
     m_bits = ArrayUtil.Grow(m_bits, numWords);
     m_wlen = numWords;
     Debug.Assert((this.numBits = Math.Max(this.numBits, numWords << 6)) >= 0);
 }
Example #4
0
 public override int[] Init()
 {
     return(bytesStart = new int[ArrayUtil.Oversize(m_initSize, RamUsageEstimator.NUM_BYTES_INT32)]);
 }
Example #5
0
 /// <summary>
 /// Create a <see cref="GrowableByteArrayDataOutput"/> with the given initial capacity. </summary>
 public GrowableByteArrayDataOutput(int cp)
 {
     this.bytes  = new byte[ArrayUtil.Oversize(cp, 1)];
     this.Length = 0;
 }