By default, the AWS SDK reads object data into an auto-growing StringStream. To avoid copies, read directly into our preallocated buffer instead. See https://github.com/aws/aws-sdk-cpp/issues/64 for an alternative but functionally similar recipe.
| 1327 | // See https://github.com/aws/aws-sdk-cpp/issues/64 for an alternative but |
| 1328 | // functionally similar recipe. |
| 1329 | Aws::IOStreamFactory AwsWriteableStreamFactory(void* data, int64_t nbytes) { |
| 1330 | return [=]() { return Aws::New<StringViewStream>("", data, nbytes); }; |
| 1331 | } |
| 1332 | |
| 1333 | Result<S3Model::GetObjectResult> GetObjectRange(Aws::S3::S3Client* client, |
| 1334 | const S3Path& path, |