Function ion_c_sys::ion_reader_reset_stream_with_length[][src]

pub unsafe extern "C" fn ion_reader_reset_stream_with_length(
    p_hreader: *mut hREADER,
    handler_state: *mut c_void,
    fn_input_handler: ION_STREAM_HANDLER,
    length: POSITION
) -> iERR
Expand description

Resets input user-managed stream for given reader.

Readers’ current stream would be closed and would be initialized with given stream. Resets the state of the reader to be at the top level. Symbol table and other reader state such as whether its a binary or a text reader is retained. A common pattern when using this interface would be to open the reader with a user-managed-stream, Then call ion_reader_next which will read the ion version marker and the initial local symbol table (if one is present). At that point the symbol table will be current. A later user-managed-stream seek is immediately followed by calling this API. This ensures symbol table is retained and reader/parser state is valid following the random jump; and parsing continues unhindered from thereon. @param p_hreader Reader object for which input stream is to be reset @param handler_state Object that contains a buffer to store the read-in data from input stream. @param fn_input_handler Function used to read from input stream and refill the buffer. the handler is responsible for setting start, curr and limit of reader object. @param length Length of the user-managed-stream. An EOF by the reader when this length is reached. @return IERR_OK if succeeded