Utility for file io.
Reservoir sampling