Existing ways of adding content to an S3 file using methods in AmazonS3 class are
Is there a way an OutputStream can be created for an existing S3 object to which values from a list can be written into? I see there are no APIs for doing so.
It's possible to create an S3OutputStream which wraps the AmazonS3 client. See this gist for the implementation: https://gist.github.com/blagerweij/ad1dbb7ee2fff8bcffd372815ad310eb It automatically detects large files, and uses multi-part transfers when required. It uses a byte-array for buffering, the size of that buffer depends on your use case. (default is 10MB)
For example:
final S3Client s3Client = AmazonS3ClientBuilder.defaultClient();
final OutputStream out = new S3OutputStream(s3Client, "bucket", "path/file.ext");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With