Here you can find the source of int2ByteArray(int num)
public static byte[] int2ByteArray(int num)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] int2ByteArray(int num) { byte[] b = new byte[4]; b[0] = (byte) (num >>> 24); b[1] = (byte) (num >>> 16); b[2] = (byte) (num >>> 8); b[3] = (byte) num; return b; }// w w w .jav a2 s . c om }