Terminate reads when read returns -1
Update version detection so that each JAR prints its own version, instead of the API version always