Here you can find the source of intToBytes(int in)
public static byte[] intToBytes(int in)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] intToBytes(int in) { byte[] b; b = new byte[] { (byte) (in >>> 24 & 0xFF), (byte) (in >>> 16 & 0xFF), (byte) (in >>> 8 & 0xFF), (byte) (in >>> 0 & 0xFF) }; return b; }/* w w w . jav a 2 s .c om*/ }