Here you can find the source of intArrayToByteArray(int[] ai)
public static byte[] intArrayToByteArray(int[] ai)
//package com.java2s; //License from project: LGPL public class Main { public static byte[] intArrayToByteArray(int[] ai) { byte[] ab = new byte[ai.length * 4]; for (int i = 0; i < ai.length; i++) { ab[i * 4] = (byte) (ai[i] >> 24); ab[i * 4 + 1] = (byte) (ai[i] >> 16); ab[i * 4 + 2] = (byte) (ai[i] >> 8); ab[i * 4 + 3] = (byte) ai[i]; }//w ww. j a v a 2s . c om return ab; } }