Currently these two functions save file on the disk and read file from disk. If you instead return and get a file-like object to and from user, it will be much more flexible since users can work with file-like objects directly. As an application of this, they could work with data without writing them on the disk if that's not necessary for the application.