Here you can find the source of int32ToByteArr(int val, byte[] arr, int offset)
public final static void int32ToByteArr(int val, byte[] arr, int offset)
//package com.java2s; /******************************************************************* * DUBwise/*from ww w .j av a 2 s .c o m*/ * by Marcus -Ligi- Bueschleb * http://ligi.de * * License: * * http://creativecommons.org/licenses/by-nc-sa/2.0/de/ * (Creative Commons / Non Commercial / Share Alike) * Additionally to the Creative Commons terms it is not allowed * to use this project in _any_ violent manner! * This explicitly includes that lethal Weapon owning "People" and * Organisations (e.g. Army & Police) * are not allowed to use this Project! * **********************************************************************/ public class Main { public final static void int32ToByteArr(int val, byte[] arr, int offset) { arr[offset] = (byte) ((0xFF) & (val)); arr[offset + 1] = (byte) ((0xFF) & (val >> 8)); arr[offset + 2] = (byte) ((0xFF) & (val >> 16)); arr[offset + 3] = (byte) ((0xFF) & (val >> 24)); } }