Java Long Number Array Create LongArrayFrom(long[] array)

Here you can find the source of LongArrayFrom(long[] array)

Description

Answer a Long array from the supplied array of longs

License

Open Source License

Parameter

Parameter Description
array a parameter

Return

a Long array from the supplied array of longs

Declaration

public static Long[] LongArrayFrom(long[] array) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 Oracle.//from   w  w  w  .j  a  va2 s .c  o m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Apache License v2.0 which accompanies this distribution. 
 * The Eclipse Public License is available at
 *     http://www.eclipse.org/legal/epl-v10.html
 * and the Apache License v2.0 is available at 
 *     http://www.opensource.org/licenses/apache2.0.php.
 * You may elect to redistribute this code under either of these licenses.
 *
 * Contributors:
 *     Hal Hildebrand - Initial JMX support 
 ******************************************************************************/

public class Main {
    /**
     * Answer a Long array from the supplied array of longs
     * 
     * @param array
     * @return a Long array from the supplied array of longs
     */
    public static Long[] LongArrayFrom(long[] array) {
        if (array == null) {
            return new Long[0];
        }
        Long[] result = new Long[array.length];
        for (int i = 0; i < array.length; i++) {
            result[i] = array[i];
        }
        return result;
    }
}

Related

  1. longArray(int len)
  2. LongArrayFrom(long[] array)
  3. toLongA(byte[] data)
  4. toLongArray(boolean[] array)
  5. toLongArray(byte[] array)
  6. toLongArray(byte[] byteArray)