Here you can find the source of toIntegerArray(final int[] array)
Parameter | Description |
---|---|
array | the primitive int array to convert into an Integer wrapper object array. |
public static Integer[] toIntegerArray(final int[] array)
//package com.java2s; public class Main { /**//from w ww . j av a 2 s .c om * Converts the primitive int array into an Integer wrapper object array. * </p> * @param array the primitive int array to convert into an Integer wrapper object array. * @return an Integer array containing the values from the elements in the primitive int array. */ public static Integer[] toIntegerArray(final int[] array) { final Integer[] integerArray = new Integer[array == null ? 0 : array.length]; if (array != null) { for (int index = 0; index < array.length; index++) { integerArray[index] = array[index]; } } return integerArray; } }