Java Integer Create toInt(short[] arr)

Here you can find the source of toInt(short[] arr)

Description

Converts an array of short values to an array of integer values.

License

Open Source License

Parameter

Parameter Description
arr a short array

Return

an integer array

Declaration

public static int[] toInt(short[] arr) 

Method Source Code

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

public class Main {
    /**/*from  w w  w .  j a  va 2  s . c o m*/
     * Converts an array of short values to an array of integer values. Returns a
     * new array.
     *
     * @param   arr a short array
     * @return  an integer array
     */
    public static int[] toInt(short[] arr) {
        int n = arr.length;
        int[] converted = new int[n];
        for (int i = 0; i < n; i++) {
            converted[i] = arr[i];
        }
        return converted;
    }
}

Related

  1. toInt(Object vo)
  2. toInt(short leftShort, short rightShort)
  3. ToInt(short n1, short n2)
  4. toInt(short s0, short s1)
  5. toInt(short x, short y)
  6. toInt(String arr, String separator)
  7. toInt(String chars)
  8. toInt(String input, int defaultValue)
  9. toInt(String input, int offset, int length)