text: public Position Get(int pos){while (pos >= nextPos){if (count == positions.Length){Position[] newPositions = new Position[ArrayUtil.Oversize(1 + count, RamUsageEstimator.NUM_BYTES_OBJECT_REF)];System.Array.Copy(positions, nextWrite, newPositions, 0, positions.Length - nextWrite);System.Array.Copy(positions, 0, newPositions, positions.Length - nextWrite, nextWrite);for (int i = positions.Length; i < newPositions.Length; i++){newPositions[i] = new Position();}nextWrite = positions.Length;positions = newPositions;}if (nextWrite == positions.Length){nextWrite = 0;}Debug.Assert(positions[nextWrite].count == 0);positions[nextWrite++].pos = nextPos++;count++;}Debug.Assert(InBounds(pos));int index = GetIndex(pos);Debug.Assert(positions[index].pos == pos);return positions[index];}