code: public void setAll(int index, ByteArray items) {
      rangeCheck(index, index + items.size);
      for (int i = index, j = 0; j < items.size; i++, j++) {
        elements[i] = items.elements[j];
      }
    }
docs: Sets a range of elements of this array.
  
  @param index
  The index of the first element to set.
  @param items
  The values to set.
  @throws IndexOutOfBoundsException
  if
  <code>index &lt; 0 || index + items.size() &gt; size()</code>.