You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice that, for a simple upload of an InputStream, an entire S3Resource has to be created along with the S3OutputStream. This results in putting all the data or in memory or to disk
It would be nice to have, in S3Operations and S3Template, an upload method that has the following signature:
S3Resource upload(String bucketName, String key, InputStream inputStream, long contentLength)
This should call S3Client.putObject with RequestBody.fromInputStream, that uses the input stream and the content length so not to read the file twice, or dump in memory or on file.
The text was updated successfully, but these errors were encountered:
The S3OutputStream implementations we provide don't store complete file in memory or on disk, see InMemoryBufferingS3OutputStream.
I understand the reasoning but we would have to make it very clear that this particular method does not use the S3OutputStream but goes directly to SDK.
Thinking about it, in fact what I wanted is something that uploads the InputStream without hitting the filesystem or putting everything in memory when the file is huge, so I guess that InMemoryBufferingS3OutputStream is perfect.
I leave this issue open though, because it might be interesting for someone else.
A decent implementation available in this lib: InMemoryBufferingS3OutputStream.
In a Spring app usage is quite clean, just inject S3OutputStreamProvider:
Type: Feature
I notice that, for a simple upload of an
InputStream
, an entireS3Resource
has to be created along with theS3OutputStream
. This results in putting all the data or in memory or to diskIt would be nice to have, in
S3Operations
andS3Template
, an upload method that has the following signature:This should call
S3Client.putObject
withRequestBody.fromInputStream
, that uses the input stream and the content length so not to read the file twice, or dump in memory or on file.The text was updated successfully, but these errors were encountered: