Here you can find the source of int2byteWithInvert(int input)
public static byte[] int2byteWithInvert(int input)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] int2byteWithInvert(int input) { byte[] b = int2byte(input); int len = b.length; byte[] rtn = new byte[len]; for (int i = 0; i < len; i++) { rtn[i] = b[len - 1 - i];/*from w w w . j a v a 2 s. co m*/ } return rtn; } public static byte[] int2byte(int input) { byte[] result = new byte[4]; for (int i = 0;; i++) { if (i >= 4) return result; result[i] = (byte) (0xFF & input >> i * 8); } } }