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.
| 1267 | // See https://github.com/aws/aws-sdk-cpp/issues/64 for an alternative but |
| 1268 | // functionally similar recipe. |
| 1269 | Aws::IOStreamFactory AwsWriteableStreamFactory(void* data, int64_t nbytes) { |
| 1270 | return [=]() { return Aws::New<StringViewStream>("", data, nbytes); }; |
| 1271 | } |
| 1272 | |
| 1273 | Result<S3Model::GetObjectResult> GetObjectRange(Aws::S3::S3Client* client, |
| 1274 | const S3Path& path, |