Here you can find the source of intToByteArray(final int v, final byte[] buf, final int offset)
public static final void intToByteArray(final int v, final byte[] buf, final int offset)
//package com.java2s; //License from project: Apache License public class Main { public static final void intToByteArray(final int v, final byte[] buf, final int offset) { buf[offset + 0] = (byte) ((v >> 24) & 0xFF); buf[offset + 1] = (byte) ((v >> 16) & 0xFF); buf[offset + 2] = (byte) ((v >> 8) & 0xFF); buf[offset + 3] = (byte) ((v >> 0) & 0xFF); }/* www .j ava 2 s. c o m*/ }