Hi.
In your webrev:
+ if ((length | fromIndex | size) < 0 || size > length - fromIndex)
+ throw outOfBounds(fromIndex, size, length, oobe);
In Buffer.java (equivalent if adding "| size"):
static void checkBounds(int off, int len, int size) { // package-private
if ((off | len | (off + len) | (size - (off + len))) < 0)
throw new IndexOutOfBoundsException();
}
Maybe the second way (only one boolean check) is better for perfs?
-Jeff
