Problem
S3Client offers no way to stream an object's content from S3. The only download method, downloadTextFile(), reads the entire object into memory as a String, which is impractical for large binary files.
Solution
Add new public methods to S3Client:
openObjectStream(String key): should perform a streaming GET request and return the raw InputStream backed by the HTTP response, so callers are able to read large objects without buffering them in memory. Should return null if the object does not exist. The caller is responsible for closing the stream.
Alternatives
No response
Problem
S3Clientoffers no way to stream an object's content from S3. The only download method,downloadTextFile(), reads the entire object into memory as aString, which is impractical for large binary files.Solution
Add new public methods to
S3Client:openObjectStream(String key): should perform a streaming GET request and return the rawInputStreambacked by the HTTP response, so callers are able to read large objects without buffering them in memory. Should returnnullif the object does not exist. The caller is responsible for closing the stream.Alternatives
No response