glywk commented on PR #3230: URL: https://github.com/apache/avro/pull/3230#issuecomment-2448335370
> I think this change would break the symmetry between `DataFileReaderBase` and `DataFileWriterBase`. To remain symmetric we can simply `reset()` `stream_` in `close()` instead of replacing it with ClosedInputStream. Any attempt to read from the file after closing it should ideally throw an exception. But `std::unique_ptr` specification make it undefined behavior. But then, the behavior is the same if one tries to write into `DataFileWriterBase` after closing it. Thank you for your analysis. Generally, I prefer to keep object instance in valid state in any lifetime step. But I can remove `ClosedInputStream` and simply `reset()` `stream_` without make it undefined behaviour. And symmetry is respected between `DataFileReaderBase` and `DataFileWriterBase`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
