Here you can find the source of int2ByteArray1(int value)
public static byte[] int2ByteArray1(int value)
//package com.java2s; public class Main { public static byte[] int2ByteArray1(int value) { byte[] b = new byte[1]; for (int i = 0; i < 1; i++) { int offset = (b.length - 1 - i) * 8; b[i] = (byte) ((value >>> offset) & 0xFF); }/* w ww . j a va2 s . co m*/ return b; } }