Here you can find the source of unsignedNumericToByteArray(long src, int length)
public static byte[] unsignedNumericToByteArray(long src, int length)
//package com.java2s; public class Main { public static byte[] unsignedNumericToByteArray(long src, int length) { byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = (byte) (src >>> (length - 1 - i) * 8 & 0xff); }//from ww w .ja v a 2 s . c o m return result; } }