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