There are ways to get this without reading the entire file into memory. Given the known metadata files this approach shouldn't be an issue, but you might want to add a note acknowledging it in the event someone comes along in the future when the requirements have changed.