Here you can find the source of byteArrayFromInteger(int integer)
public static byte[] byteArrayFromInteger(int integer)
//package com.java2s; /**//from ww w .j ava2 s . c om * This code is free software; you can redistribute it and/or modify it under * the terms of the new BSD License. * * Copyright (c) 2008-2009, Sebastian Staudt */ public class Main { public static byte[] byteArrayFromInteger(int integer) { return new byte[] { (byte) (integer >> 24), (byte) (integer >> 16), (byte) (integer >> 8), (byte) integer }; } }