Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for reading binary Ion 1.1 delimited containers. #764

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

tgregg
Copy link
Contributor

@tgregg tgregg commented Mar 7, 2024

Description of changes:

Any suggestions for simplification are appreciated. No performance testing has yet been done.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@popematt popematt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have a few questions.

Comment on lines +1671 to +1672
// Pin the current buffer offset so that all bytes encountered while finding the end of the delimited container
// are buffered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a requirement to be able to pre-fill a delimited container? That seems somewhat antithetical to the use cases that delimited containers are intended to support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a requirement in order to comply with the following APIs/contracts:

  • IonCursor's fillValue, which allows the user to fill any value at any depth (note: there is no proposed API to expose to the user whether or not a container is delimited, so it is not reasonable to restrict usage of this API to length-prefixed containers)
  • The reader's "incremental" mode, which uses fillValue under the hood to ensure the next top-level value is buffered before returning a non-null type from IonReader.next().

When incremental mode is not enabled (which is the common case), and when IonCursor.fillValue is not used directly (there are no direct users yet), delimited containers will not be pre-filled.

@tgregg tgregg merged commit 4cd5c75 into ion-11-encoding Apr 19, 2024
6 of 31 checks passed
@tgregg tgregg deleted the ion-11-encoding-read-delimited branch April 19, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants