Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

feat: add limit support to ReadChannel #688

Merged
merged 1 commit into from Jan 31, 2022
Merged

Conversation

BenWhitehead
Copy link
Contributor

@BenWhitehead BenWhitehead commented Jan 25, 2022

Add new methods to ReadChannel to allow limiting of the channel independent of any chunk sizes or buffers.

Motivation

GCS supports range reads of objects, ReadChannel currently has seek to allow settings the begin offset,
but doesn't provide limit to all seeing the end offset. The only alternative is to provide manually sized
ByteBuffer(s) to read into that would have to track size externally.

This new feature allows the Channel itself to absorb the burden and prevent reading more bytes than necessary from GCS.

Related to googleapis/java-storage#1180

@BenWhitehead BenWhitehead requested a review from a team as a code owner January 25, 2022 21:11
Add new methods to ReadChannel to allow limiting of the channel independent of any chunk sizes or buffers.

###### Motivation
GCS supports range reads of objects, ReadChannel currently has `seek` to allow settings the begin offset, but doesn't provide limit to all seeing the end offset. The only alternative is to provide manually sized ByteBuffer(s) to read into that would have to track size externally.

This new feature allows the Channel itself ot absorb the burden and prevent reading more bytes than necessary from GCS.
@BenWhitehead BenWhitehead merged commit 476109e into main Jan 31, 2022
@BenWhitehead BenWhitehead deleted the limitable-read-channel branch January 31, 2022 18:00
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 3, 2022
🤖 I have created a release *beep* *boop*
---


## [2.5.0](v2.4.0...v2.5.0) (2022-02-02)


### Features

* add limit support to ReadChannel ([#688](#688)) ([476109e](476109e))


### Bug Fixes

* **java:** Initialize AsyncSSLPrivateKeyMethod (a grpc netty class) at run-time ([#702](#702)) ([24146a3](24146a3))


### Dependencies

* update dependency com.google.api:gax-bom to v2.12.0 ([#698](#698)) ([c10aab8](c10aab8))
* update dependency com.google.protobuf:protobuf-bom to v3.19.4 ([#699](#699)) ([5d163f5](5d163f5))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
suztomo pushed a commit to googleapis/sdk-platform-java that referenced this pull request Mar 21, 2023
🤖 I have created a release *beep* *boop*
---


## [2.5.0](googleapis/java-core@v2.4.0...v2.5.0) (2022-02-02)


### Features

* add limit support to ReadChannel ([#688](googleapis/java-core#688)) ([9543eb2](googleapis/java-core@9543eb2))


### Bug Fixes

* **java:** Initialize AsyncSSLPrivateKeyMethod (a grpc netty class) at run-time ([#702](googleapis/java-core#702)) ([af1c9b3](googleapis/java-core@af1c9b3))


### Dependencies

* update dependency com.google.api:gax-bom to v2.12.0 ([#698](googleapis/java-core#698)) ([34bbad8](googleapis/java-core@34bbad8))
* update dependency com.google.protobuf:protobuf-bom to v3.19.4 ([#699](googleapis/java-core#699)) ([9e2f077](googleapis/java-core@9e2f077))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants