Skip to content

Conversation

@0marperez
Copy link
Contributor

@0marperez 0marperez commented Oct 30, 2025

Issue #

N/A

Description of changes

Used by aws/aws-sdk-kotlin#1712

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

@0marperez 0marperez added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Oct 30, 2025
@0marperez 0marperez requested a review from a team as a code owner October 30, 2025 02:52
* @param sink the buffer that data read from the source will be appended to
*/
@InternalApi
public fun SdkSource.readRemaining(sink: SdkBuffer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should return the total bytes read

@0marperez 0marperez requested a review from lauzadis October 30, 2025 19:53
totalReadBytes += readBytes
} while (readBytes != -1L)

return totalReadBytes + 1L // Account for last -1 read
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should be counting the -1L. Can you write some unit tests for this function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants