Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static long[] toLongArray(Collection<? extends Number> c) { long arr[] = new long[c.size()]; int i = 0; for (Number item : c) { arr[i++] = item.longValue(); } return arr; } }