Here you can find the source of toShortArray(List
public static short[] toShortArray(List<Short> list)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static short[] toShortArray(List<Short> list) { if (isNullOrEmpty(list)) { return null; }// www .j a v a 2s . c om short[] shorts = new short[list.size()]; for (int i = 0; i < shorts.length; i++) { shorts[i] = list.get(i); } return shorts; } public static boolean isNullOrEmpty(Collection c) { return c == null || c.isEmpty(); } public static boolean isNullOrEmpty(String s) { return s == null || s.isEmpty(); } }