Here you can find the source of max(byte[] lArray, byte[] rArray)
final public static byte[] max(byte[] lArray, byte[] rArray)
//package com.java2s; //License from project: Apache License public class Main { final public static byte[] max(byte[] lArray, byte[] rArray) { int cmp = compare(lArray, 0, lArray.length, rArray, 0, rArray.length); if (cmp >= 0) { return lArray; } else {//w ww.j ava 2s . c o m return rArray; } } final public static int compare(byte[] lArray, int leftOffset, int lSize, byte[] rArray, int rightOffset, int rSize) { int i = leftOffset; int j = rightOffset; int n = lSize; for (int k = 0; k < n; k++, i++, j++) { if (k >= rSize) { return 1; } int cmp = (lArray[i] & 0xFF) - (rArray[j] & 0xFF); if (cmp != 0) { return cmp; } } if (lSize < rSize) { return -1; } return 0; } }