Oops, I forgot to add an #include guard! (How embarrassing...)
Set eof appropriately when decoding from a stream