Skip to content

Redundant byte array copying in AsyncRequestBody #1735

@RoKish

Description

@RoKish

Describe the bug

It doesn't make sense to copy a byte array in AsyncRequestBody#fromBytes and AsyncRequestBody#fromByteBuffer since the byte array is copied in the constructor of ByteArrayAsyncRequestBody afterwards.

Possible Solution

I think the best solution will be to copy the byte array in the constructor of ByteArrayAsyncRequestBody. Another constructor should be added to accept offset and length in order to support copying from ByteBuffer.

Your Environment

  • AWS Java SDK version used: 2.7.15

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions