Here you can find the source of int2minBeb(final int x)
public static byte[] int2minBeb(final int x) throws IllegalArgumentException
//package com.java2s; //License from project: Apache License public class Main { public static byte[] int2minBeb(final int x) throws IllegalArgumentException { if (x <= 0xFFFF) { if (x <= 0xFF) { if (x < 0) throw new IllegalArgumentException(); return new byte[] { (byte) x }; }//from w w w . jav a 2 s .c o m return new byte[] { (byte) (x >> 8), (byte) x }; } if (x <= 0xFFFFFF) return new byte[] { (byte) (x >> 16), (byte) (x >> 8), (byte) x }; return new byte[] { (byte) (x >> 24), (byte) (x >> 16), (byte) (x >> 8), (byte) x }; } }