Fixed issue: NETTY-29 (ChannelBufferInputStream.readFully(byte[], int, int) should throw IndexOutOfBoundsException.)

* ChannelBufferInputstream.checkAvailable() throws IndexOutOfBoundsException instead of IllegalArgumentException now.
This commit is contained in:
Trustin Lee 2008-08-25 11:45:13 +00:00
parent a4edbd444e
commit 88833d9ded

View File

@ -232,7 +232,7 @@ public class ChannelBufferInputStream extends InputStream implements DataInput {
private void checkAvailable(int fieldSize) throws IOException {
if (fieldSize < 0) {
throw new IllegalArgumentException();
throw new IndexOutOfBoundsException();
}
if (fieldSize > available()) {
throw new EOFException();