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