Returns an array containing the same values as array, but guaranteed to be of a specified minimum length. If array already has a length of at least minLength, it is returned directly. Otherwise, a new array of size minLength + padding is returned, containing the value
(int[] array, int minLength, int padding)
| 375 | * {@code minLength} |
| 376 | */ |
| 377 | public static int[] ensureCapacity(int[] array, int minLength, int padding) { |
| 378 | checkArgument(minLength >= 0, "Invalid minLength: %s", minLength); |
| 379 | checkArgument(padding >= 0, "Invalid padding: %s", padding); |
| 380 | return (array.length < minLength) ? Arrays.copyOf(array, minLength + padding) : array; |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Returns a string containing the supplied {@code int} values separated by {@code separator}. For |
nothing calls this directly
no test coverage detected