Here you can find the source of fromInt(int value, byte[] arr, int offset)
public static void fromInt(int value, byte[] arr, int offset)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] fromInt(int value) { byte[] arr = new byte[4]; fromInt(value, arr, 0);//from w ww.j a v a2s .c o m return arr; } public static void fromInt(int value, byte[] arr, int offset) { value ^= 1 << 31;//toggling highest bit arr[offset] = (byte) (value >>> 24); arr[offset + 1] = (byte) (value >>> 16); arr[offset + 2] = (byte) (value >>> 8); arr[offset + 3] = (byte) value; } }