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