Open
Description
Describe the issue
The example shown for the javadoc of forBlockingOutputStream is:
S3AsyncClient s3 = S3AsyncClient.create(); // Use one client for your whole application!
byte[] dataToSend = "Hello".getBytes(StandardCharsets.UTF_8);
long lengthOfDataToSend = dataToSend.length();
// Start the operation
BlockingInputStreamAsyncRequestBody body =
AsyncRequestBody.forBlockingOutputStream(lengthOfDataToSend);
CompletableFuture<PutObjectResponse> responseFuture =
s3.putObject(r -> r.bucket("bucketName").key("key"), body);
// Write the input stream to the running operation
try (CancellableOutputStream outputStream = body.outputStream()) {
outputStream.write(dataToSend);
}
// Wait for the service to respond.
PutObjectResponse response = responseFuture.join();
This shows a BlockingInputStreamAsyncRequestBody
(notice Input
) being returned from the method, but the should be a BlockingOutputStreamAsyncRequestBody
.