Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static long[] buildLongArray(ArrayList<Long> longList) { long[] longArray = new long[longList.size()]; int i = 0; for (Long l : longList) { longArray[i++] = l; } return longArray; } }