Java Long Number Array Create toLongArray(final long[] longs)

Here you can find the source of toLongArray(final long[] longs)

Description

Produces an array of Long objects from a long[].

License

Open Source License

Parameter

Parameter Description
longs the array to be converted

Return

an array of objects

Declaration

public static Long[] toLongArray(final long[] longs) 

Method Source Code

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

public class Main {
    /**/*ww w  .  ja  v a 2 s.  c o  m*/
     * Produces an array of {@link Long} objects from a <code>long[]</code>.
     * <p>
     * Can be used to produce an array of objects to feed an iterator
     * 
     * @param longs the array to be converted
     * @return an array of {@link Long} objects
     */
    public static Long[] toLongArray(final long[] longs) {
        final Long[] result = new Long[longs.length];
        for (int i = 0; i < longs.length; i++) {
            result[i] = Long.valueOf(longs[i]);
        }
        return result;
    }
}

Related

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