Here you can find the source of intToByte(int number)
public static byte[] intToByte(int number)
//package com.java2s; public class Main { public static byte[] intToByte(int number) { int temp = number; byte[] b = new byte[4]; for (int i = 0; i < b.length; i++) { b[i] = new Integer(temp & 0xff).byteValue(); temp = temp >> 8;/*w ww . j a v a2 s. c o m*/ } return b; } }