properly pass along io.EOF when reading from an io.Reader