Java Long Number Array Create toLongArray(final byte[] array)

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

Description

to Long Array

License

Open Source License

Declaration

public static long[] toLongArray(final byte[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long[] toLongArray(final byte[] array) {
        return toLongArray(array, 0, array.length);
    }//from  w w w.j  a  v  a  2s. co  m

    public static long[] toLongArray(final byte[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final byte[] from, final int fromOff, final int len, final long[] 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 long[] toLongArray(final char[] array) {
        return toLongArray(array, 0, array.length);
    }

    public static long[] toLongArray(final char[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final char[] from, final int fromOff, final int len, final long[] 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 long[] toLongArray(final short[] array) {
        return toLongArray(array, 0, array.length);
    }

    public static long[] toLongArray(final short[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final short[] from, final int fromOff, final int len, final long[] 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 long[] toLongArray(final int[] array) {
        return toLongArray(array, 0, array.length);
    }

    public static long[] toLongArray(final int[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final int[] from, final int fromOff, final int len, final long[] 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 long[] toLongArray(final float[] array) {
        return toLongArray(array, 0, array.length);
    }

    public static long[] toLongArray(final float[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final float[] from, final int fromOff, final int len, final long[] to,
            final int toOff) {
        final int end = fromOff + len;

        for (int i = fromOff, j = toOff; i < end; i++, j++) {
            to[j] = (long) from[i];
        }

        return to;
    }

    public static long[] toLongArray(final double[] array) {
        return toLongArray(array, 0, array.length);
    }

    public static long[] toLongArray(final double[] array, final int off, final int len) {
        return toLongArray(array, off, len, new long[len], 0);
    }

    public static long[] toLongArray(final double[] from, final int fromOff, final int len, final long[] to,
            final int toOff) {
        final int end = fromOff + len;

        for (int i = fromOff, j = toOff; i < end; i++, j++) {
            to[j] = (long) from[i];
        }

        return to;
    }
}

Related

  1. toLongArray(byte[] array)
  2. toLongArray(byte[] byteArray)
  3. toLongArray(byte[] byteArray)
  4. toLongArray(byte[] data)
  5. toLongArray(double[][] array)
  6. toLongArray(final int[] in)
  7. toLongArray(final long[] longs)
  8. toLongArray(int... coordinates)
  9. toLongArray(Number[] array)