pub unsafe extern "C" fn svn_string_from_stream2(
result: *mut *mut svn_string_t,
stream: *mut svn_stream_t,
len_hint: apr_size_t,
result_pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description
Read the contents of @a stream into memory, from its current position to its end, returning the data in @a *result. The stream will be closed when it has been successfully and completely read.
@a len_hint gives a hint about the expected length, in bytes, of the actual data that will be read from the stream. It may be 0, meaning no hint is being provided. Efficiency in time and/or in space may be better (and in general will not be worse) when the actual data length is equal or approximately equal to the length hint.
The returned memory is allocated in @a result_pool, and any temporary allocations may be performed in @a scratch_pool.
@note The present implementation is efficient when @a len_hint is big enough (but not vastly bigger than necessary), and also for actual lengths up to 64 bytes when @a len_hint is 0. Otherwise it can incur significant time and space overheads. See source code for details.
@since New in 1.10