Here you can find the source of convertIntArray(int[] in)
Parameter | Description |
---|---|
in | the array to be converted |
public static byte[] convertIntArray(int[] in)
//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; } }