Java Utililty Methods List to Primitive Array

List of utility methods to do List to Primitive Array

Description

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

Method

long[]toPrimitiveLongArray(List l)
to Primitive Long Array
long[] arr = new long[l.size()];
for (int i = 0; i < l.size(); i++) {
    arr[i] = l.get(i);
return arr;
long[]ToPrimitiveLongArray(List list)
To Primitive Long Array
Iterator<Long> iterator = list.iterator();
long[] array = new long[list.size()];
for (int i = 0; i < array.length; i++) {
    array[i] = iterator.next();
return array;
int[]toPrimitives(List oInt)
to Primitives
if (oInt == null) {
    return null;
return toPrimitives(oInt.toArray(new Integer[0]));