Skip to content

Conversation

@aajtodd
Copy link
Contributor

@aajtodd aajtodd commented May 27, 2021

Issue #, if available:
fixes aws/aws-sdk-kotlin#147

Description of changes:

  • (fix): fixes the behavior of reserve() to take into account existing data. We were erroneously basing the new buffer size only on the incoming data and not including the amount already written
  • (refactor): add asReadOnly() to create a read only view of a buffer which works similar to ByteBuffer.asReadOnly()
  • (refactor): added static of() to create a buffer using an existing ByteArray or ByteBuffer as the backing memory
  • (refactor): fixed the plugin versions to actually match the gradle.properties versions

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aajtodd aajtodd requested a review from ianbotsf May 27, 2021 18:00
Comment on lines +18 to +19
internal actual fun Memory.Companion.ofByteArray(src: ByteArray, offset: Int, length: Int): Memory =
Memory.of(src, offset, length)
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Why is this platform-dependent? Couldn't this be implemented in common instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You'd think so but it does not exist in ktor-io common. I'm not sure why but I suspect some limitation of K/N as it exists today. But I agree which is why I defined the extension in common and figure it will resolve itself or we'll deal with it when the time comes

@aajtodd aajtodd merged commit f8600b2 into main May 28, 2021
@aajtodd aajtodd deleted the refactor-sdk-io branch May 28, 2021 13:04
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.

An exception is thrown for SQS Delete Message

2 participants