KEMBAR78
feat: allow limiting ReadChannel by BenWhitehead · Pull Request #1180 · googleapis/java-storage · GitHub
Skip to content

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
Contributor

@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