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

feat: allow limiting ReadChannel #1180

Merged
merged 4 commits into from
Mar 18, 2022
Merged

feat: allow limiting ReadChannel #1180

merged 4 commits into from
Mar 18, 2022

Conversation

BenWhitehead
Copy link
Collaborator

The ReadChannel returned from storage.reader and blob.reader now also implemented LimitableReadChannel which allows limiting the max number of bytes the channel will make available for read.

This can be used in conjunction with seek to allow for range gets of objects independent of any buffer or chunk sizes.

See the integration tests for an example of how this could be used.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Dec 16, 2021
@BenWhitehead BenWhitehead marked this pull request as ready for review March 18, 2022 16:14
@BenWhitehead BenWhitehead requested a review from a team as a code owner March 18, 2022 16:14
The ReadChannel returned from storage.reader and blob.reader now allow limiting the max number of bytes the channel will make available for read.
 Use ReadChannel#limit(long) to set the limit.

This can be used in conjunction with seek to allow for range gets of objects independent of any buffer or chunk sizes.
Copy link
Member

@frankyn frankyn left a comment

Choose a reason for hiding this comment

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

One nit, otherwise LGTM, amazing work Ben!!

@BenWhitehead BenWhitehead added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 18, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 18, 2022
@BenWhitehead BenWhitehead merged commit 2898ee8 into googleapis:main Mar 18, 2022
@BenWhitehead BenWhitehead deleted the reader-limit branch March 18, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants