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
(char[] array, int minLength, int padding)
| 351 | |
| 352 | |
| 353 | public static char[] ensureCapacity(char[] array, int minLength, int padding) { |
| 354 | checkArgument(minLength >= 0, "Invalid minLength: %s", minLength); |
| 355 | checkArgument(padding >= 0, "Invalid padding: %s", padding); |
| 356 | return (array.length < minLength) ? Arrays.copyOf(array, minLength + padding) : array; |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * Returns a string containing the supplied {@code char} values separated by {@code separator}. |
nothing calls this directly
no test coverage detected