Skip to content

Commit 2fde0c0

Browse files
committed
Udpate CrtRequestBodyAdapter
1 parent 0fee2ae commit 2fde0c0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

core/crt-core/src/main/java/software/amazon/awssdk/crtcore/CrtRequestBodyAdapter.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,20 @@
2222
import software.amazon.awssdk.utils.async.ByteBufferStoringSubscriber;
2323
import software.amazon.awssdk.utils.async.ByteBufferStoringSubscriber.TransferResult;
2424

25+
/**
26+
* This class adapts a {@link Publisher} of {@link ByteBuffer} to the CRT {@link HttpRequestBodyStream}.
27+
*/
2528
@SdkProtectedApi
2629
public final class CrtRequestBodyAdapter implements HttpRequestBodyStream {
2730
private static final int BUFFER_SIZE = 4 * 1024 * 1024; // 4 MB
2831
private final Publisher<ByteBuffer> requestPublisher;
2932
private final long contentLength;
3033
private ByteBufferStoringSubscriber requestBodySubscriber;
3134

32-
public CrtRequestBodyAdapter(Publisher<ByteBuffer> requestPublisher, long contentLength, long readLimit) {
35+
public CrtRequestBodyAdapter(Publisher<ByteBuffer> requestPublisher, long contentLength) {
3336
this.requestPublisher = requestPublisher;
3437
this.contentLength = contentLength;
35-
this.requestBodySubscriber = new ByteBufferStoringSubscriber(readLimit);
36-
}
37-
38-
public CrtRequestBodyAdapter(Publisher<ByteBuffer> requestPublisher, long contentLength) {
39-
this(requestPublisher, contentLength, BUFFER_SIZE);
38+
this.requestBodySubscriber = new ByteBufferStoringSubscriber(BUFFER_SIZE);
4039
}
4140

4241
@Override

0 commit comments

Comments
 (0)