Java Long Number Array Create toLongArray(final int[] in)

Here you can find the source of toLongArray(final int[] in)

Description

Convert integer array to long array

License

Open Source License

Parameter

Parameter Description
in a parameter

Return

long array

Declaration

public static final long[] toLongArray(final int[] in) 

Method Source Code

//package com.java2s;
/*-//  w  w w .j  a  va  2  s  .  c  o  m
 * Copyright 2015 Diamond Light Source Ltd.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    /**
     * Convert integer array to long array
     * @param in
     * @return long array
     */
    public static final long[] toLongArray(final int[] in) {
        if (in == null)
            return null;

        long[] out = new long[in.length];
        for (int i = 0; i < in.length; i++) {
            out[i] = in[i];
        }
        return out;
    }
}

Related

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