Fix a bug on input stream exhaustion.

Previously we were throwing because readByte() requires a byte. Instead
just return -1.