Java Integer Convert To convertIntArray(int[] in)

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

Description

This function converts an array of type int into an array of type byte

License

Open Source License

Parameter

Parameter Description
in the array to be converted

Return

out the byte-array that corresponds the input

Declaration

public static byte[] convertIntArray(int[] in) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   ww w  . ja  v  a2s  . c  om
     * This function converts an array of type int into an array of type byte
     *
     * @param in the array to be converted
     * @return out
     *         the byte-array that corresponds the input
     */
    public static byte[] convertIntArray(int[] in) {
        byte[] out = new byte[in.length];
        for (int i = 0; i < in.length; i++) {
            out[i] = (byte) in[i];
        }
        return out;
    }
}

Related

  1. convertInt2Byte(int data)
  2. convertInt2Bytes(int data)
  3. convertInt32(int v, boolean isLE)
  4. convertInt8(int v)
  5. convertIntArray(int[] arr)
  6. convertIntArrayFromHex(char[] hex)
  7. convertIntBitsMSBinaryToIEEE(int source)
  8. convertIntColourToByteArray(int intColour)
  9. convertIntDouble(int[][] in)