Add error message to the buffer overflow exception

This commit is contained in:
Elias Naur 2004-03-29 19:09:10 +00:00
parent 0e70f051bd
commit 3382ee14f6
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class BufferChecks {
*/
static void checkBuffer(Buffer buf, int size) {
if (buf.remaining() < size) {
throw new BufferOverflowException();
throw new IllegalArgumentException("Number of remaining buffer elements is " + buf.remaining() + ", must be at least " + size);
}
}
/**