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

misc: Update docs for ByteStream.writeToOutputStream, add ByteStream.appendToOutputStream #1172

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

lauzadis
Copy link
Contributor

@lauzadis lauzadis commented Oct 30, 2024

Issue #

Closes awslabs/aws-sdk-kotlin#1444

Description of changes

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

Copy link

Affected Artifacts

Changed in size
Artifact Pull Request (bytes) Latest Release (bytes) Delta (bytes) Delta (percentage)
runtime-core-jvm.jar 808,774 806,502 2,272 0.28%
aws-signing-tests-jvm.jar 456,568 456,608 -40 -0.01%
http-test-jvm.jar 58,718 58,725 -7 -0.01%
test-suite-jvm.jar 93,931 97,936 -4,005 -4.09%

@lauzadis lauzadis marked this pull request as ready for review October 30, 2024 17:59
@lauzadis lauzadis requested a review from a team as a code owner October 30, 2024 17:59
Comment on lines +148 to +152
val src = when (val stream = this@appendToOutputStream) {
is ByteStream.ChannelStream -> return@withContext outputStream.writeAll(stream.readFrom())
is ByteStream.Buffer -> stream.bytes().source()
is ByteStream.SourceStream -> stream.readFrom()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Duplicated code

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Comment on lines +148 to +152
val src = when (val stream = this@appendToOutputStream) {
is ByteStream.ChannelStream -> return@withContext outputStream.writeAll(stream.readFrom())
is ByteStream.Buffer -> stream.bytes().source()
is ByteStream.SourceStream -> stream.readFrom()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@lauzadis lauzadis merged commit 792a6f8 into main Oct 31, 2024
16 checks passed
@lauzadis lauzadis deleted the misc-bytestream-closure branch October 31, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ByteStreamJVM.writeToOutputStream is documented as not closing the provided stream, but does close it
3 participants