Description of changes:
Prior to this PR when a user managed buffer is read with the intention of filling a page, the handler for the buffer is called only once. No information is provided to the handler in order to communicate how much data is needed.
This resulted in user managed buffers not correctly seeking and the reader falling out of sync with the underlying buffer. More details can be seen in issue #318.
This PR updates the _ion_stream_fread function to ensure that the user managed buffer handler is called enough times to fill the requested buffer, stopping early in the cases of error, or insufficient data.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: 318
Description of changes: Prior to this PR when a user managed buffer is read with the intention of filling a page, the handler for the buffer is called only once. No information is provided to the handler in order to communicate how much data is needed.
This resulted in user managed buffers not correctly seeking and the reader falling out of sync with the underlying buffer. More details can be seen in issue #318.
This PR updates the
_ion_stream_fread
function to ensure that the user managed buffer handler is called enough times to fill the requested buffer, stopping early in the cases of error, or insufficient data.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.