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