As a convenience function, MuPDF provides a mechanism for reading the entire contents of a stream into a fz_buffer.
This will throw an error (and hence not return any data) if an error is encountered during the decode of the stream. Sometimes it can be preferable to `do the best we can' and tolerate problematic data. For such cases, we provide fz_read_best: