Java tutorial
//package com.java2s; import java.util.Iterator; import java.util.List; public class Main { public static final long[] listLong2longarray(List<Long> list) { final long[] dst = new long[list.size()]; int i = 0; for (Iterator<Long> iter = list.iterator(); iter.hasNext();) { dst[i++] = (iter.next()).longValue(); } return dst; } }