SAP-samples / cloud-objectstore-java-sample

The Object Store reference application aims to provide a single-code line application, which can be run in SAP BTP, Cloud Foundry environment, consuming Object Store service with different IaaS providers underneath - e.g. AWS, GCS, Azure.
Apache License 2.0
15 stars 16 forks source link

Streaming support for upload/download content from/to object store #10

Open i073821 opened 3 years ago

i073821 commented 3 years ago

Dear colleagues,

One of the known issues mentioned in this github page is that 'there are connection issues with using input streams instead of byte array'. Since the issue still remains unsolved, is it recommended to only transact with the objectstore as byte array (and not use streaming at all)? Or is it ok to use input/output streams? For files larger in size, I guess, streaming would result in a sizable performance gain. Can you please advice us on this?

To be more specific, BlobBuilder has an overloaded payload method - taking either InputStream or byte[] as an argument. Can we use the InputStream one without any side effects?

For downloading content, since the example provided uses InputStream, I guess there are no problems with it, right?

Regards, Raghu

biswaranjanray commented 2 years ago

Hi,

You may find some examples and code snippets in JClouds here pertaining to the creation of a payload. Interestingly most of the examples use byte as the source to create payloads instead of streams. Maybe using streams is a constraint in jclouds api since the issue is still open till date. And you're right, streaming would adversely impact the performance. We recommend to try with small files for both uploading and downloading operations as we observed issues with large files.

Thanks