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
(byte[] array, int minLength, int padding)
| 202 | |
| 203 | |
| 204 | public static byte[] ensureCapacity(byte[] array, int minLength, int padding) { |
| 205 | checkArgument(minLength >= 0, "Invalid minLength: %s", minLength); |
| 206 | checkArgument(padding >= 0, "Invalid padding: %s", padding); |
| 207 | return (array.length < minLength) ? Arrays.copyOf(array, minLength + padding) : array; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Returns an array containing each value of {@code collection}, converted to a {@code byte} value |
nothing calls this directly
no test coverage detected