Several mistakes were made past where the stream was expected to raise
the EOF flag when reaching the end of stream. That is incorrect. The
flag is only raised if the current read operation fails.
This commit unifies all istream compatibility code to use 'canRead'
for reliable EOF detection. An exception is now thrown when a
value cannot be read completely (e.g. missing bytes).
Version comments are added for easier backtracing.