svn_stringbuf_from_stream

Function svn_stringbuf_from_stream 

Source
pub unsafe extern "C" fn svn_stringbuf_from_stream(
    result: *mut *mut svn_stringbuf_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. This function does not close the @a stream upon completion.

@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.

@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.9.