Here you can find the source of UIntToByte2(int value)
public static byte[] UIntToByte2(int value)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] UIntToByte2(int value) { if (value < 0) value = 0;/*from w w w. java 2s . c o m*/ if (value > Short.MAX_VALUE) value = Short.MAX_VALUE; value += Short.MIN_VALUE; return new byte[] { (byte) (value >>> 8), (byte) value }; } }