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