Here you can find the source of intToByteArray(int value)
public static byte[] intToByteArray(int value)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] intToByteArray(int value) { try {// w w w.ja v a 2 s.c o m return new byte[] { (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) (value) }; } catch (NullPointerException npe) { return null; } } }