Booleans.ensureCapacity(boolean[] array, int minLength, int padding) Method

Definition

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 values of array, and zeroes in the remaining places.

public static boolean[] ensureCapacity(boolean[] array, int minLength, int padding)

Parameters

array
boolean[]

the source array

minLength
int

the minimum length the returned array must guarantee

padding
int

an extra amount to "grow" the array by if growth is necessary

Returns

boolean[]

an array containing the values of array, with guaranteed minimum length minLength

Applies to