Function mupdf_sys::fz_read_best
source · pub unsafe extern "C" fn fz_read_best(
ctx: *mut fz_context,
stm: *mut fz_stream,
initial: usize,
truncated: *mut c_int,
worst_case: usize
) -> *mut fz_buffer
Expand description
Attempt to read a stream into a buffer. If truncated is NULL behaves as fz_read_all, sets a truncated flag in case of error.
stm: The stream to read from.
initial: Suggested initial size for the buffer.
truncated: Flag to store success/failure indication in.
worst_case: 0 for unknown, otherwise an upper bound for the size of the stream.
Returns a buffer created from reading from the stream.