Returns the greatest value present in array. @param array a nonempty array of byte values @return the value present in array that is greater than or equal to every other value in the array @throws IllegalArgumentException if array is empty
(byte... array)
| 164 | |
| 165 | |
| 166 | public static byte max(byte... array) { |
| 167 | checkArgument(array.length > 0); |
| 168 | int max = toInt(array[0]); |
| 169 | for (int i = 1; i < array.length; i++) { |
| 170 | int next = toInt(array[i]); |
| 171 | if (next > max) { |
| 172 | max = next; |
| 173 | } |
| 174 | } |
| 175 | return (byte) max; |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * Returns a string representation of x, where x is treated as unsigned. |
nothing calls this directly
no test coverage detected