Issue #6629: Fix a data corruption issue in the new `io` package, which could