Closes the stream.
void close();
Remarks
Calls rdbuf()->close() and, if that function returns a null pointer, calls setstate(failbit) (which may throw ios_base::failure).
rdbuf()->close()
setstate(failbit)
ios_base::failure