Here you can find the source of intToBytes(int number)
public static byte[] intToBytes(int number)
//package com.java2s; public class Main { public static byte[] intToBytes(int number) { return new byte[] { (byte) ((number >> 24) & 0xFF), (byte) ((number >> 16) & 0xFF), (byte) ((number >> 8) & 0xFF), (byte) (number & 0xFF) }; }/* ww w. j a v a2s . com*/ }