throw ArithmeticException on integer overflow from size
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
a51b5db209
commit
602cd7e5c0
|
@ -59,7 +59,7 @@ public class ByteBufferAccumulator implements AutoCloseable
|
|||
{
|
||||
int length = 0;
|
||||
for (ByteBuffer buffer : _buffers)
|
||||
length += buffer.remaining();
|
||||
length = Math.addExact(length, buffer.remaining());
|
||||
return length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue