I'm not sure you meant the user should catch EOFException (IOException) to know there is no more data.   I think reaching EOF is a normal process and should not be handled as an exception.