Here you can find the source of intToBigEndianByteArray(int in)
public static byte[] intToBigEndianByteArray(int in)
//package com.java2s; //License from project: Apache License public class Main { public static byte[] intToBigEndianByteArray(int in) { return new byte[] { (byte) ((in >> 24) & 0xFF), (byte) ((in >> 16) & 0xFF), (byte) ((in >> 8) & 0xFF), (byte) (in & 0xFF) }; }/* w w w . j a v a2 s . c o m*/ }