framework for reading files from memory