Add error message to the buffer overflow exception
This commit is contained in:
parent
0e70f051bd
commit
3382ee14f6
|
@ -66,7 +66,7 @@ class BufferChecks {
|
||||||
*/
|
*/
|
||||||
static void checkBuffer(Buffer buf, int size) {
|
static void checkBuffer(Buffer buf, int size) {
|
||||||
if (buf.remaining() < size) {
|
if (buf.remaining() < size) {
|
||||||
throw new BufferOverflowException();
|
throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue