-
Sub-task
-
Resolution: Delivered
-
P4
-
16
`DataInputStream.readFully(byte[] b, int off, int len)` now correctly throws specified `NullPointerException` and `IndexOutOfBoundsException`.
`DataInputStream.readFully(byte[] b, int off, int len)` is specified to throw a `NullPointerException` if `b` is `null`, and an `IndexOutOfBoundsException` if `off` is negative, `len` is negative, or `len` is greater than `b.length - off`. For example if `b` was `null` and `len` was zero, then the method would fail silently without throwing a `NullPointerException`. Also if `b` was non-`null`, `off` was negative and `len` was zero, then the method would fail silently without throwing an `IndexOutOfBoundsException`. The implementation has been corrected to throw the respective exceptions as specified.
`DataInputStream.readFully(byte[] b, int off, int len)` is specified to throw a `NullPointerException` if `b` is `null`, and an `IndexOutOfBoundsException` if `off` is negative, `len` is negative, or `len` is greater than `b.length - off`. For example if `b` was `null` and `len` was zero, then the method would fail silently without throwing a `NullPointerException`. Also if `b` was non-`null`, `off` was negative and `len` was zero, then the method would fail silently without throwing an `IndexOutOfBoundsException`. The implementation has been corrected to throw the respective exceptions as specified.