Here you can find the source of int2byte(int[] ia)
public static byte[] int2byte(int[] ia)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] int2byte(int[] ia) { int length = ia.length; byte[] ba = new byte[length * 4]; for (int i = 0, j = 0, k; i < length;) { k = ia[i++];/*from w ww . ja v a 2 s. c o m*/ ba[j++] = (byte) ((k >>> 24) & 0xFF); ba[j++] = (byte) ((k >>> 16) & 0xFF); ba[j++] = (byte) ((k >>> 8) & 0xFF); ba[j++] = (byte) (k & 0xFF); } return (ba); } }