Hi,

the InputStream.read(byte[], int, int) method [1] can throw
* IOException
* NullPointerException
* IndexOutOfBoundsException

Is there a recommended priority for the conditions associated to the exceptions to be checked? For example, if the arguments are invalid and the stream is already closed, which exception shall be thrown?


Greetings
Raffaello

----

[1] https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/io/InputStream.html#read(byte%5B%5D,int,int)

Reply via email to