Closing the response InputStream #558
Answered
by
ryber
gtaylor1981
asked this question in
Q&A
-
|
Should I close the response e.g. |
Beta Was this translation helpful? Give feedback.
Answered by
ryber
Jan 12, 2026
Replies: 1 comment 2 replies
-
|
When you do a "try with resource" as you have done here the try will automatically close the resource as long as it implements Closeable (which InputStream does). This is effectively done in a magical finally block |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes it is always best practice to close a InputStream or else resources could be left hanging.