Here you can find the source of max_array(byte[] arr)
public static byte max_array(byte[] arr)
//package com.java2s; //License from project: Open Source License public class Main { public static byte max_array(byte[] arr) { if (arr != null && arr.length > 0) { byte max = arr[0]; for (int i = 0; i < arr.length; i++) { if (arr[i] > max) { max = arr[i];/* w ww. j av a 2s . com*/ } } return max; } return Byte.MIN_VALUE; } public static short max_array(short[] arr) { if (arr != null && arr.length > 0) { short max = arr[0]; for (int i = 0; i < arr.length; i++) { if (arr[i] > max) { max = arr[i]; } } return max; } return Short.MIN_VALUE; } public static int max_array(int[] arr) { if (arr != null && arr.length > 0) { int max = arr[0]; for (int i = 0; i < arr.length; i++) { if (arr[i] > max) { max = arr[i]; } } return max; } return Integer.MIN_VALUE; } public static long max_array(long[] arr) { if (arr != null && arr.length > 0) { long max = arr[0]; for (int i = 0; i < arr.length; i++) { if (arr[i] > max) { max = arr[i]; } } return max; } return Long.MIN_VALUE; } }