Here you can find the source of int2byte(int ival, byte b[], int offset)
public static void int2byte(int ival, byte b[], int offset)
//package com.java2s; public class Main { /** *///from w w w.jav a 2 s . c om public static void int2byte(int ival, byte b[], int offset) { int bits = 32; for (int i = 0; i < 4; i++) { bits -= 8; b[offset + i] = (byte) ((ival >> bits) & 0xff); } } }