This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add limit support to ReadChannel (#688)
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 allow setting 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.
- Loading branch information
1 parent
233f4ae
commit 476109e
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- see https://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html --> | ||
<differences> | ||
<!-- Clear doesn't know about default interface methods --> | ||
<difference> | ||
<differenceType>7012</differenceType> | ||
<className>com/google/cloud/ReadChannel</className> | ||
<method>* limit(long)</method> | ||
</difference> | ||
<difference> | ||
<differenceType>7012</differenceType> | ||
<className>com/google/cloud/ReadChannel</className> | ||
<method>long limit()</method> | ||
</difference> | ||
</differences> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters