Java tutorial
//package com.java2s; public class Main { public static byte intToByte(int i) { return Integer.valueOf(Integer.toHexString(i), 16).byteValue(); } }