ion-c
ion-c copied to clipboard
Clarify and make consistent the purpose of the p_bytes_flushed output parameter to ion_writer_finish and ion_writer_flush
This parameter is documented as "the number of bytes written into the buffer/stream". Is that the total number of bytes ever written to the stream, or the total number of bytes written to the stream by that call? The behavior appears to be inconsistent between text and binary writers. This should be fixed, and the documentation clarified.
Another option is to deprecate the current flush/finish functions in favor of versions without the output parameter. Users would be directed to use ion_stream_get_position
to get the size of the stream. They should do this anyway until this issue is resolved.