Here you can find the source of toDoubleArray(final byte[] array)
public static double[] toDoubleArray(final byte[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static double[] toDoubleArray(final byte[] array) { return toDoubleArray(array, 0, array.length); }/*from www. j a v a 2 s . c om*/ public static double[] toDoubleArray(final byte[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final byte[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static double[] toDoubleArray(final char[] array) { return toDoubleArray(array, 0, array.length); } public static double[] toDoubleArray(final char[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final char[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static double[] toDoubleArray(final short[] array) { return toDoubleArray(array, 0, array.length); } public static double[] toDoubleArray(final short[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final short[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static double[] toDoubleArray(final int[] array) { return toDoubleArray(array, 0, array.length); } public static double[] toDoubleArray(final int[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final int[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static double[] toDoubleArray(final long[] array) { return toDoubleArray(array, 0, array.length); } public static double[] toDoubleArray(final long[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final long[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } public static double[] toDoubleArray(final float[] array) { return toDoubleArray(array, 0, array.length); } public static double[] toDoubleArray(final float[] array, final int off, final int len) { return toDoubleArray(array, off, len, new double[len], 0); } public static double[] toDoubleArray(final float[] from, final int fromOff, final int len, final double[] to, final int toOff) { final int end = fromOff + len; for (int i = fromOff, j = toOff; i < end; i++, j++) { to[j] = from[i]; } return to; } }