Here you can find the source of doubleToShort(double[] values)
public static short[] doubleToShort(double[] values)
//package com.java2s; public class Main { public static short[] doubleToShort(double[] values) { if (values == null) { return null; }/*from www. j a v a 2 s . c o m*/ short[] results = new short[values.length]; for (int i = 0; i < values.length; i++) { results[i] = (short) values[i]; } return results; } }