Here you can find the source of int2byte(int i)
public static final byte[] int2byte(int i)
//package com.java2s; public class Main { public static final byte[] int2byte(int i) { byte dest[] = new byte[4]; dest[3] = (byte) (i & 0xff); dest[2] = (byte) (i >>> 8 & 0xff); dest[1] = (byte) (i >>> 16 & 0xff); dest[0] = (byte) (i >>> 24 & 0xff); return dest; }/*from w w w. j av a 2s.c o m*/ }