Android Utililty Methods Array Create

List of utility methods to do Array Create

Description

The list of methods to do Array Create are organized into topic(s).

Method

short[]nullToEmpty(short[] array)

Defensive programming technique to change a null reference to an empty one.

This method returns an empty array for a null input array.

As a memory optimizing technique an empty array passed in will be overridden with the empty public static references in this class.

if (array == null || array.length == 0) {
    return EMPTY_SHORT_ARRAY;
return array;
T[]toArray(final T... items)
Create a type-safe generic array.
return items;