[][src]Function compu_brotli_sys::BrotliEncoderTakeOutput

pub unsafe extern "C" fn BrotliEncoderTakeOutput(
    state: *mut BrotliEncoderState,
    size: *mut usize
) -> *const u8

Acquires pointer to internal output buffer.

This method is used to make language bindings easier and more efficient: -# push data to ::BrotliEncoderCompressStream, until ::BrotliEncoderHasMoreOutput returns BROTL_TRUE -# use ::BrotliEncoderTakeOutput to peek bytes and copy to language-specific entity

Also this could be useful if there is an output stream that is able to consume all the provided data (e.g. when data is saved to file system).

@attention After every call to ::BrotliEncoderTakeOutput @p *size bytes of output are considered consumed for all consecutive calls to the instance methods; returned pointer becomes invalidated as well.

@note Encoder output is not guaranteed to be contiguous. This means that after the size-unrestricted call to ::BrotliEncoderTakeOutput, immediate next call to ::BrotliEncoderTakeOutput may return more data.

@param state encoder instance @param[in, out] size @b in: number of bytes caller is ready to take, @c 0 if any amount could be handled; \n @b out: amount of data pointed by returned pointer and considered consumed; \n out value is never greater than in value, unless it is @c 0 @returns pointer to output data