Skip to content

Commit d2b6063

Browse files
committed
Avoid extra byte array copying when downloading to memory with AsyncResponseTransformer
1 parent 6812d25 commit d2b6063

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "",
5+
"description": "Avoid extra byte array copying when downloading to memory with AsyncResponseTransformer"
6+
}

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/async/ByteArrayAsyncResponseTransformer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class ByteArrayAsyncResponseTransformer<ResponseT> implements
4747
@Override
4848
public CompletableFuture<ResponseBytes<ResponseT>> prepare() {
4949
cf = new CompletableFuture<>();
50-
return cf.thenApply(arr -> ResponseBytes.fromByteArray(response, arr));
50+
return cf.thenApply(arr -> ResponseBytes.fromByteArrayUnsafe(response, arr));
5151
}
5252

5353
@Override

0 commit comments

Comments
 (0)