Correct way to convert a file whose source is S3

Im using groupdocs version 23.12 ,and im looking for the best practice to convert a file whose source is S3 to be more precise
S3Object object = this.client.getObject(Bucket.PUBLIC.getFullBucketName(), filename);
object.getObjectContent() which returns S3ObjectInputStream
im converting to PNG and i would like to get the ByteBufferOutputStream outputStream

1 Like

@urin

Please take a look at this documentation article - Load document from Amazon S3 storage. However, to get output as ByteBufferOutputStream, you could do following adjustments in the same documentation code:

ByteBufferOutputStream outputStream = new ByteBufferOutputStream();
Converter converter = new Converter(downloadFile(key));
PngConvertOptions options = new PngConvertOptions();
converter.convert(outputStream, options);

// Access the converted data as ByteBuffer
ByteBuffer convertedData = outputStream.getByteBuffer();