Here you can find the source of integerToByte(int i)
public static byte[] integerToByte(int i)
//package com.java2s; public class Main { public static byte[] integerToByte(int i) { byte[] buffer = new byte[4]; buffer[0] = (byte) (i); buffer[1] = (byte) (i >> 8); buffer[2] = (byte) (i >> 16); buffer[3] = (byte) (i >> 24); return buffer; }//from www. ja v a2 s .co m }