Here you can find the source of toShortArray(List
Parameter | Description |
---|---|
list | The list to convert |
public static short[] toShortArray(List<Short> list)
//package com.java2s; import java.util.List; public class Main { /**/* w w w. j av a2 s .c om*/ * This converts a list to it's primitive state. * In this case, it converts a {@link Short} list to a * short array. * * @param list The list to convert * @return The primitive array instance of the list's contents. */ public static short[] toShortArray(List<Short> list) { short[] array = new short[list.size()]; for (int i = 0; i < list.size(); i++) { array[i] = list.get(i); } return array; } public static short[] toShortArray(short... arr) { return arr; } }