Here you can find the source of toLong(short[] arr)
Parameter | Description |
---|---|
arr | a short array |
public static long[] toLong(short[] arr)
//package com.java2s; //License from project: Open Source License public class Main { /**/* www . j a v a 2 s .c o m*/ * Converts an array of short values to an array of long values. Returns a * new array. * * @param arr a short array * @return a long array */ public static long[] toLong(short[] arr) { int n = arr.length; long[] converted = new long[n]; for (int i = 0; i < n; i++) { converted[i] = arr[i]; } return converted; } /** * Converts an array of integer values to an array of long values. Returns a * new array. * * @param arr an integer array * @return a long array */ public static long[] toLong(int[] arr) { int n = arr.length; long[] converted = new long[n]; for (int i = 0; i < n; i++) { converted[i] = arr[i]; } return converted; } }