Here you can find the source of fromIntToByte(int integer)
public static byte[] fromIntToByte(int integer)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] fromIntToByte(int integer) { String s = String.valueOf(integer); byte[] b = new byte[s.length()]; for (int i = 0; i < s.length(); i++) { b[i] = (byte) s.charAt(i); }/*from w w w . ja v a2 s .c o m*/ return b; } }