Returns the items as an array. Note the array is typed, so the #Array(ArraySupplier) constructor must have been used. Otherwise use #toArray(ArraySupplier) to specify the array type.
()
| 587 | /** Returns the items as an array. Note the array is typed, so the {@link #Array(ArraySupplier)} constructor must have been |
| 588 | * used. Otherwise use {@link #toArray(ArraySupplier)} to specify the array type. */ |
| 589 | public T[] toArray () { |
| 590 | return Arrays.copyOf(items, size); |
| 591 | } |
| 592 | |
| 593 | public T[] toArray (ArraySupplier<T[]> arraySupplier) { |
| 594 | T[] result = arraySupplier.get(size); |