Skip to content

Commit

Permalink
fixed missing MAX_VALUE support
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Feb 22, 2018
1 parent 9b03c3d commit 183b51d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void checkUnsignedBounds(long value, int numberOfBytes) {

public static void checkUnsignedBounds(BigInteger value, int numberOfBytes) {
BigInteger upperBound = BigInteger.valueOf(2).pow(8 * numberOfBytes);
if (value.compareTo(BigInteger.ZERO) < 0 || value.compareTo(upperBound) > 0) {
if (value.compareTo(BigInteger.ZERO) < 0 || value.compareTo(upperBound) >= 0) {
throw new IllegalArgumentException("Value must between 0 and " + upperBound + ". Was " + value);
}
}
Expand Down

0 comments on commit 183b51d

Please sign in to comment.