Clarification regarding correct usage of ResponseInputStream#abort and #close #5978
Labels
documentation
This is a problem with documentation.
needs-triage
This issue or PR still needs to be triaged.
Describe the issue
Using a
ReponseInputStream
in a try-with-resources block combined with a call toabort
can lead to a 'premature end of stream' error.As an example, the following code
produces an exception with this stack trace
Is this the expected behaviour? The javadoc for ReponseInputStream seems to suggest that
abort
should be used instead ofclose
. That does make it rather difficult to useabort
in combination with try-with-resources.Links
https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/ResponseInputStream.html
The text was updated successfully, but these errors were encountered: