Here you can find the source of intToBytesBE(int value, byte[] buffer)
public static void intToBytesBE(int value, byte[] buffer)
//package com.java2s; //License from project: Open Source License public class Main { public static void intToBytesBE(int value, byte[] buffer) { intToBytesBE(value, buffer, 0, buffer.length); }//from www .ja v a 2s .c o m public static void intToBytesBE(int value, byte[] buffer, int offset, int length) { for (int i = offset + length - 1; i >= offset; --i) { buffer[i] = (byte) value; value >>>= 8; } } }