Is it needed to close the passed in InputStream on the putObject method of the Amazon Java SDK for S3?
Their example only shows usage with a File, but not with an InputStream. The Javadoc also does not indicate if it is needed or not.
In the case of the S3 client, a provided InputStream is not closed by the call.
The relevant code is S3DataSource.Utils.cleanupDataSource(), which is called in a finally block for PutObject and similar calls.
This is a general Java convention, but since it's not documented there's no guarantee that it will remain this way. Perhaps file feedback?
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