Java Double Array Create toDoubleArray(final byte[] array)

Here you can find the source of toDoubleArray(final byte[] array)

Description

to Double Array

License

Open Source License

Declaration

public static double[] toDoubleArray(final byte[] array) 

Method Source Code

//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;
    }
}

Related

  1. toDoubleArr(short[] arr)
  2. toDoubleArray(boolean[] array)
  3. toDoubleArray(byte[] byteArray)
  4. toDoubleArray(byte[] data)
  5. toDoubleArray(Double[] data)
  6. toDoubleArray(final long[] array)
  7. toDoubleArray(final Object[] array)
  8. toDoubleArray(int... intArray)
  9. toDoubleArray(int[] ints)