Here you can find the source of int2ByteArray(int i)
public static byte[] int2ByteArray(int i)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] int2ByteArray(int i) { byte[] result = new byte[4]; result[0] = (byte) ((i >> 24) & 0xFF); result[1] = (byte) ((i >> 16) & 0xFF); result[2] = (byte) ((i >> 8) & 0xFF); result[3] = (byte) (i & 0xFF); return result; }// w w w .ja v a2s . com }