Here you can find the source of toIntArray(Integer[] data)
public static int[] toIntArray(Integer[] data)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static int[] toIntArray(Integer[] data) { int[] result = new int[data.length]; for (int i = 0; i < data.length; i++) result[i] = data[i].intValue(); return result; }/* w w w . jav a 2 s .c o m*/ public static int[] toIntArray(List<Integer> data) { int[] result = new int[data.size()]; for (int i = 0; i < data.size(); i++) result[i] = data.get(i).intValue(); return result; } }